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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
14193fb91a
commit
88db4721d4
@@ -174,6 +174,7 @@ int kobject_shadow_add(struct kobject * kobj, struct dentry *shadow_parent)
|
|||||||
if (!*kobj->k_name) {
|
if (!*kobj->k_name) {
|
||||||
pr_debug("kobject attempted to be registered with no name!\n");
|
pr_debug("kobject attempted to be registered with no name!\n");
|
||||||
WARN_ON(1);
|
WARN_ON(1);
|
||||||
|
kobject_put(kobj);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
parent = kobject_get(kobj->parent);
|
parent = kobject_get(kobj->parent);
|
||||||
|
Reference in New Issue
Block a user