kobject: new_device->kref wasn't putted after error in kobject_move()
If error happen we jump to "out" label, in this case new_device not yet became the parent but it wasn't putted. Signed-off-by: Monakhov Dmitriy <dmonakhov@openvz.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
a2807dbcbd
commit
9e993efb0d
@ -385,9 +385,11 @@ int kobject_move(struct kobject *kobj, struct kobject *new_parent)
|
|||||||
goto out;
|
goto out;
|
||||||
old_parent = kobj->parent;
|
old_parent = kobj->parent;
|
||||||
kobj->parent = new_parent;
|
kobj->parent = new_parent;
|
||||||
|
new_parent = NULL;
|
||||||
kobject_put(old_parent);
|
kobject_put(old_parent);
|
||||||
kobject_uevent_env(kobj, KOBJ_MOVE, envp);
|
kobject_uevent_env(kobj, KOBJ_MOVE, envp);
|
||||||
out:
|
out:
|
||||||
|
kobject_put(new_parent);
|
||||||
kobject_put(kobj);
|
kobject_put(kobj);
|
||||||
kfree(devpath_string);
|
kfree(devpath_string);
|
||||||
kfree(devpath);
|
kfree(devpath);
|
||||||
|
Loading…
Reference in New Issue
Block a user