aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPatrick Mochel <mochel@osdl.org>2002-12-01 11:24:34 -0600
committerPatrick Mochel <mochel@osdl.org>2002-12-01 11:24:34 -0600
commit659c204070e5d33cbe12dfc580ec8f53b66d2618 (patch)
tree37f967f06e144d5991c381f838f91ab0ccfee319 /lib
parentfc8aae5360008cf232c5f5bdc65b772a73a248c2 (diff)
downloadhistory-659c204070e5d33cbe12dfc580ec8f53b66d2618.tar.gz
kobjects: don't do cleanup if kobject_add() fails.
kobject_register() has the rude behavior that it will attempt to clean up the kobject if kobject_add() fails. This replaces that with a WARN_ON() for the return value, and leaves the cleanup to the caller.
Diffstat (limited to 'lib')
-rw-r--r--lib/kobject.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/kobject.c b/lib/kobject.c
index bdf6636d2b2ed9..04b1fd760d45dc 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -110,8 +110,7 @@ int kobject_register(struct kobject * kobj)
if (kobj) {
kobject_init(kobj);
error = kobject_add(kobj);
- if (error)
- kobject_cleanup(kobj);
+ WARN_ON(error);
} else
error = -EINVAL;
return error;