driver core: bus_add_driver should return an error if no bus
authorGreg Kroah-Hartman <gregkh@suse.de>
Fri, 20 Apr 2007 18:29:52 +0000 (11:29 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 27 Apr 2007 17:57:32 +0000 (10:57 -0700)
As pointed out by Dave Jones.

Cc: Dave Jones <davej@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/base/bus.c

index 1a5a350eca15393a92b3f5c8e1c8eca28c25a741..1d76e2349654a00f7d4370d2ae759249b34ef9b8 100644 (file)
@@ -603,7 +603,7 @@ int bus_add_driver(struct device_driver *drv)
        int error = 0;
 
        if (!bus)
-               return 0;
+               return -EINVAL;
 
        pr_debug("bus %s: add driver %s\n", bus->name, drv->name);
        error = kobject_set_name(&drv->kobj, "%s", drv->name);