mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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:
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)
|
||||
|
||||