[04/12] driver core fixes: retval check in class_register()

From: Cornelia Huck
Date: Wed Sep 13 2006 - 12:40:46 EST


From: Cornelia Huck <cornelia.huck@xxxxxxxxxx>

Check for return value of add_class_attrs() in class_register().

Signed-off-by: Cornelia Huck <cornelia.huck@xxxxxxxxxx>

class.c | 2 ++
1 file changed, 2 insertions(+)

--- linux-2.6.18-rc6/drivers/base/class.c 2006-09-12 16:19:43.000000000 +0200
+++ linux-2.6.18-rc6+CH/drivers/base/class.c 2006-09-12 17:01:12.000000000 +0200
@@ -153,6 +153,8 @@ int class_register(struct class * cls)
error = subsystem_register(&cls->subsys);
if (!error) {
error = add_class_attrs(class_get(cls));
+ if (error)
+ subsystem_unregister(&cls->subsys);
class_put(cls);
}
return error;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/