aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/base/bus.c6
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)
732 732
733 klist_init(&bus->klist_devices, klist_devices_get, klist_devices_put); 733 klist_init(&bus->klist_devices, klist_devices_get, klist_devices_put);
734 klist_init(&bus->klist_drivers, NULL, NULL); 734 klist_init(&bus->klist_drivers, NULL, NULL);
735 bus_add_attrs(bus); 735 retval = bus_add_attrs(bus);
736 if (retval)
737 goto bus_attrs_fail;
736 738
737 pr_debug("bus type '%s' registered\n", bus->name); 739 pr_debug("bus type '%s' registered\n", bus->name);
738 return 0; 740 return 0;
739 741
742bus_attrs_fail:
743 kset_unregister(&bus->drivers);
740bus_drivers_fail: 744bus_drivers_fail:
741 kset_unregister(&bus->devices); 745 kset_unregister(&bus->devices);
742bus_devices_fail: 746bus_devices_fail: