Commit dda4bcab authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[PATCH] drivers/base/hotplug.c, fix $DEVPATH

Hotplug agents couldn't use /sys/$DEVPATH after /sys/root
morphed into /sys/devices ... now they can do it again.
parent cebce9d8
......@@ -35,6 +35,8 @@
#define BUFFER_SIZE 1024 /* should be enough memory for the env */
#define NUM_ENVP 32 /* number of env pointers */
static char prefix [] = "devices"; /* /sys/devices/... */
static int do_hotplug (struct device *dev, char *argv1, const char *action,
int (* hotplug) (struct device *, char **, int, char *, int))
{
......@@ -72,7 +74,7 @@ static int do_hotplug (struct device *dev, char *argv1, const char *action,
}
dev_length = get_devpath_length (dev);
dev_length += strlen("root");
dev_length += strlen(prefix);
dev_path = kmalloc (dev_length, GFP_KERNEL);
if (!dev_path) {
kfree (buffer);
......@@ -80,7 +82,7 @@ static int do_hotplug (struct device *dev, char *argv1, const char *action,
return -ENOMEM;
}
memset (dev_path, 0x00, dev_length);
strcpy (dev_path, "root");
strcpy (dev_path, prefix);
fill_devpath (dev, dev_path, dev_length);
argv [0] = hotplug_path;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment