projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f0e1761
)
driver core fixes: bus_add_attrs() retval check
author
Cornelia Huck
<
[email protected]
>
Fri, 22 Sep 2006 09:37:04 +0000
(11:37 +0200)
committer
Greg Kroah-Hartman
<
[email protected]
>
Wed, 18 Oct 2006 19:49:55 +0000
(12:49 -0700)
Check return value of bus_add_attrs() in bus_register().
Signed-off-by: Cornelia Huck <
[email protected]
>
Signed-off-by: Greg Kroah-Hartman <
[email protected]
>
drivers/base/bus.c
patch
|
blob
|
history
diff --git
a/drivers/base/bus.c
b/drivers/base/bus.c
index 12173d16bea7332b9b76e8f19d6568dc01c5a2fd..b90f6e6f644263811bc736ce2401d28ea9e77254 100644
(file)
--- 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: