]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[PATCH] Hotplug: Make dev->bus checking consistent
authorAlexander Nyberg <alexn@dsv.su.se>
Sat, 26 Feb 2005 12:38:51 +0000 (13:38 +0100)
committerGreg KH <gregkh@suse.de>
Thu, 5 May 2005 06:44:37 +0000 (23:44 -0700)
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 <alexn@dsv.su.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/base/core.c

index a7cedd8cefe5385a8d2eb6f334c8661454c443d7..268a9c8d168b6ac72a46e0c624830b030b79df51 100644 (file)
@@ -139,7 +139,7 @@ static int dev_hotplug(struct kset *kset, struct kobject *kobj, char **envp,
        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) {