diff options
author | Patrick Mochel <mochel@osdl.org> | 2002-12-01 11:24:34 -0600 |
---|---|---|
committer | Patrick Mochel <mochel@osdl.org> | 2002-12-01 11:24:34 -0600 |
commit | 659c204070e5d33cbe12dfc580ec8f53b66d2618 (patch) | |
tree | 37f967f06e144d5991c381f838f91ab0ccfee319 /lib | |
parent | fc8aae5360008cf232c5f5bdc65b772a73a248c2 (diff) | |
download | history-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.c | 3 |
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; |