mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-10 15:10:38 +00:00
driver core: bus_add_driver should return an error if no bus
As pointed out by Dave Jones. Cc: Dave Jones <davej@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
8447891fe8
commit
4f6e1945fe
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user