[PATCH] PHYSDEVDRIVER=<NULL>

From: Olaf Hering
Date: Thu Feb 17 2005 - 09:13:18 EST



For some reasons, PHYSDEVDRIVER can be <NULL> for block events.
So just check for that.

base/class.c | 4 ++--
base/core.c | 4 ++--
block/genhd.c | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)

Signed-off-by: Olaf Hering <olh@xxxxxxx>

diff -purNx tags ../linux-2.6.11-rc4.orig/drivers/base/class.c ./drivers/base/class.c
--- ../linux-2.6.11-rc4.orig/drivers/base/class.c 2005-02-13 04:08:06.000000000 +0100
+++ ./drivers/base/class.c 2005-02-17 14:42:56.000000000 +0100
@@ -314,13 +314,13 @@ static int class_hotplug(struct kset *ks
kfree(path);

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

/* add driver name of physical device */
- if (dev->driver)
+ if (dev->driver && dev->driver->name)
add_hotplug_env_var(envp, num_envp, &i,
buffer, buffer_size, &length,
"PHYSDEVDRIVER=%s", dev->driver->name);
diff -purNx tags ../linux-2.6.11-rc4.orig/drivers/base/core.c ./drivers/base/core.c
--- ../linux-2.6.11-rc4.orig/drivers/base/core.c 2005-02-13 04:05:10.000000000 +0100
+++ ./drivers/base/core.c 2005-02-17 14:42:08.000000000 +0100
@@ -121,13 +121,13 @@ static int dev_hotplug(struct kset *kset
int retval = 0;

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

/* add driver name of physical device */
- if (dev->driver)
+ if (dev->driver && dev->driver->name)
add_hotplug_env_var(envp, num_envp, &i,
buffer, buffer_size, &length,
"PHYSDEVDRIVER=%s", dev->driver->name);
diff -purNx tags ../linux-2.6.11-rc4.orig/drivers/block/genhd.c ./drivers/block/genhd.c
--- ../linux-2.6.11-rc4.orig/drivers/block/genhd.c 2005-02-13 04:06:23.000000000 +0100
+++ ./drivers/block/genhd.c 2005-02-17 14:43:26.000000000 +0100
@@ -453,13 +453,13 @@ static int block_hotplug(struct kset *ks
kfree(path);

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

/* add driver name of physical device */
- if (dev->driver)
+ if (dev->driver && dev->driver->name)
add_hotplug_env_var(envp, num_envp, &i,
buffer, buffer_size, &length,
"PHYSDEVDRIVER=%s", dev->driver->name);
-
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/