From: Greg Kroah-Hartman Date: Fri, 20 Apr 2007 18:29:52 +0000 (-0700) Subject: driver core: bus_add_driver should return an error if no bus X-Git-Tag: v2.6.22-rc1~1119^2~10 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f6e1945fecad6ac8134e9fa68b7708e55690e9e;p=linux-2.6 driver core: bus_add_driver should return an error if no bus As pointed out by Dave Jones. Cc: Dave Jones Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 1a5a350eca..1d76e23496 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c @@ -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);