Skip to contentSkip to conversation

PHYSDEVDRIVER=<NULL>

PATCH In review Olaf Hering 2 participants 3 messages Feb 17, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PHYSDEVDRIVER=<NULL>

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(-)
drivers/base/class.c renamed from linux-2.6.11-rc4.orig/drivers/base/class.c +2 -2
diff -purNx tags ../linux-2.6.11-rc4.orig/drivers/base/class.c ./drivers/base/class.c
@@ -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);
drivers/base/core.c renamed from linux-2.6.11-rc4.orig/drivers/base/core.c +2 -2
diff -purNx tags ../linux-2.6.11-rc4.orig/drivers/base/core.c ./drivers/base/core.c
@@ -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);
drivers/block/genhd.c renamed from linux-2.6.11-rc4.orig/drivers/block/genhd.c +2 -2
diff -purNx tags ../linux-2.6.11-rc4.orig/drivers/block/genhd.c ./drivers/block/genhd.c
@@ -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);
#1 lore raw
Quoted 3 lines · Olaf Hering

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

That's odd. Any idea what driver causes this? A bus should always have a name associated with it. I'd rather fix the broken bus driver.

thanks,

greg k-h

#2 lore raw
Quoted 7 lines · Greg KH
Quoted 3 lines · Olaf Hering

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

That's odd. Any idea what driver causes this? A bus should always have a name associated with it. I'd rather fix the broken bus driver.

I dont know what driver caused this, its one of these weird intel laptops.
But I fixed it in userland by quoting the enviroment variables.