[PATCH 2.6.11] fix: drivers/base/class.c

From: JustMan
Date: Thu Mar 10 2005 - 07:14:35 EST


fix: drivers/base/class.c

Signed-off-by: Serge A. Suchkov <justman@xxxxxxxxxxx>

diff -uNrp linux/drivers/base/class.orig.c linux/drivers/base/class.c
--- linux/drivers/base/class.orig.c 2005-03-10 12:19:00.000000000 +0300
+++ linux/drivers/base/class.c 2005-03-10 13:59:27.000000000 +0300
@@ -307,12 +307,14 @@ static int class_hotplug(struct kset *ks
if (class_dev->dev) {
/* add physical device, backing this device */
struct device *dev = class_dev->dev;
- char *path = kobject_get_path(&dev->kobj, GFP_KERNEL);

- add_hotplug_env_var(envp, num_envp, &i, buffer, buffer_size,
- &length, "PHYSDEVPATH=%s", path);
- kfree(path);
+ if(kobject_name(&dev->kobj)) {
+ char *path = kobject_get_path(&dev->kobj, GFP_KERNEL);

+ add_hotplug_env_var(envp, num_envp, &i, buffer, buffer_size,
+ &length, "PHYSDEVPATH=%s", path);
+ kfree(path);
+ }
/* add bus name of physical device */
if (dev->bus)
add_hotplug_env_var(envp, num_envp, &i,

--
Regards, JustMan.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/