Subject: [PATCH] Hotplug: Make dev->bus checking consistent

From: Alexander Nyberg <[email-masked]>
Date: Sat, 26 Feb 2005 13:38:51 +0100

Earlier in the same function dev->bus is checked before dereferenced,
make consistent although I honestly don't know if dev->bus could
ever be NULL

Found by the Coverity tool

Signed-off-by: Alexander Nyberg <[email-masked]>
Signed-off-by: Greg Kroah-Hartman <[email-masked]>

--- 1.91/drivers/base/core.c	2004-11-12 13:16:42 +01:00
+++ edited/drivers/base/core.c	2005-02-26 12:32:44 +01:00
@@ -139,7 +139,7 @@ static int dev_hotplug(struct kset *kset
 	buffer = &buffer[length];
 	buffer_size -= length;
 
-	if (dev->bus->hotplug) {
+	if (dev->bus && dev->bus->hotplug) {
 		/* have the bus specific function add its stuff */
 		retval = dev->bus->hotplug (dev, envp, num_envp, buffer, buffer_size);
 			if (retval) {