Commit 1bb6881a authored by Cornelia Huck's avatar Cornelia Huck Committed by Greg Kroah-Hartman

driver core fixes: bus_add_attrs() retval check

Check return value of bus_add_attrs() in bus_register().
Signed-off-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f0e1761a
...@@ -732,11 +732,15 @@ int bus_register(struct bus_type * bus) ...@@ -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_devices, klist_devices_get, klist_devices_put);
klist_init(&bus->klist_drivers, NULL, NULL); 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); pr_debug("bus type '%s' registered\n", bus->name);
return 0; return 0;
bus_attrs_fail:
kset_unregister(&bus->drivers);
bus_drivers_fail: bus_drivers_fail:
kset_unregister(&bus->devices); kset_unregister(&bus->devices);
bus_devices_fail: bus_devices_fail:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment