diff options
author | Cornelia Huck <cornelia.huck@de.ibm.com> | 2007-04-10 14:35:27 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-04-27 19:57:30 +0200 |
commit | 88db4721d47bc59b92d46de04e21c7975ea983f2 (patch) | |
tree | 1b0fd38941f3cebd8cf669a2328f656a89c7d508 /lib/kobject.c | |
parent | Kobject: kobject_uevent.c: Collapse unnecessary loop nesting (top_kobj) (diff) | |
download | linux-88db4721d47bc59b92d46de04e21c7975ea983f2.tar.xz linux-88db4721d47bc59b92d46de04e21c7975ea983f2.zip |
kobject: kobject_add() reference leak
We leak a reference if we attempt to add a kobject with no name.
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'lib/kobject.c')
-rw-r--r-- | lib/kobject.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/kobject.c b/lib/kobject.c index db1d23707eb1..eb251aae78dd 100644 --- a/lib/kobject.c +++ b/lib/kobject.c @@ -174,6 +174,7 @@ int kobject_shadow_add(struct kobject * kobj, struct dentry *shadow_parent) if (!*kobj->k_name) { pr_debug("kobject attempted to be registered with no name!\n"); WARN_ON(1); + kobject_put(kobj); return -EINVAL; } parent = kobject_get(kobj->parent); |