diff options
author | Cornelia Huck | 2006-09-22 11:37:04 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2006-10-18 21:49:55 +0200 |
commit | 1bb6881acae1c4f11a6e86f04df32ba45e95031d (patch) | |
tree | c26795fdd0f062ba741d4bbb82a960c942119e3c /drivers/base/bus.c | |
parent | driver core fixes: sysfs_create_link() retval check in class.c (diff) | |
download | kernel-qcow2-linux-1bb6881acae1c4f11a6e86f04df32ba45e95031d.tar.gz kernel-qcow2-linux-1bb6881acae1c4f11a6e86f04df32ba45e95031d.tar.xz kernel-qcow2-linux-1bb6881acae1c4f11a6e86f04df32ba45e95031d.zip |
driver core fixes: bus_add_attrs() retval check
Check return value of bus_add_attrs() in bus_register().
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base/bus.c')
-rw-r--r-- | drivers/base/bus.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 12173d16bea7..b90f6e6f6442 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c @@ -732,11 +732,15 @@ int bus_register(struct bus_type * bus) klist_init(&bus->klist_devices, klist_devices_get, klist_devices_put); klist_init(&bus->klist_drivers, NULL, NULL); - bus_add_attrs(bus); + retval = bus_add_attrs(bus); + if (retval) + goto bus_attrs_fail; pr_debug("bus type '%s' registered\n", bus->name); return 0; +bus_attrs_fail: + kset_unregister(&bus->drivers); bus_drivers_fail: kset_unregister(&bus->devices); bus_devices_fail: |