Fix xenbus_cleanup_devices() to cleanup proper subdirectories

of the deleted path, not merely paths mwith matching prefixes.

Signed-off-by: Keir Fraser <keir@xensource.com>
This commit is contained in:
kaf24@firebug.cl.cam.ac.uk committed 2006-01-13 15:22:36 +01:00
1 parent 8ffaf9c238
commit 723bbd528f
1 file changed
+11 -6
@@ -470,12 +470,17 @@ static int cleanup_dev(struct device *dev, void *data)
DPRINTK("%s", info->nodename);
if (!strncmp(xendev->nodename, info->nodename, len)) {
info->dev = xendev;
get_device(dev);
return 1;
}
return 0;
/* Match the info->nodename path, or any subdirectory of that path. */
if (strncmp(xendev->nodename, info->nodename, len))
return 0;
/* If the node name is longer, ensure it really is a subdirectory. */
if ((strlen(xendev->nodename) > len) && (xendev->nodename[len] != '/'))
return 0;
info->dev = xendev;
get_device(dev);
return 1;
}
static void xenbus_cleanup_devices(const char *path, struct bus_type *bus)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.