* [4/9] driver core fixes: bus_add_attrs() retval check
@ 2006-09-22 9:37 Cornelia Huck
0 siblings, 0 replies; only message in thread
From: Cornelia Huck @ 2006-09-22 9:37 UTC (permalink / raw)
To: Greg K-H; +Cc: linux-kernel
From: Cornelia Huck <cornelia.huck@de.ibm.com>
Check return value of bus_add_attrs() in bus_register().
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
drivers/base/bus.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- linux-2.6-CH.orig/drivers/base/bus.c
+++ linux-2.6-CH/drivers/base/bus.c
@@ -746,11 +746,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:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-09-22 9:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-22 9:37 [4/9] driver core fixes: bus_add_attrs() retval check Cornelia Huck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®