summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDmitriy Monakhov <dmonakhov@sw.ru>2007-03-03 16:11:21 +0300
committerGreg Kroah-Hartman <gregkh@suse.de>2007-03-09 15:32:58 -0800
commit9e993efb0da827634778554070f3c3ec4bdade33 (patch)
tree6852c36270693571cac9a5802a067e9c7bae3452 /lib
parenta2807dbcbd681e1f36e813fb26e2f24d15018b91 (diff)
downloadlinux-stable-9e993efb0da827634778554070f3c3ec4bdade33.tar.gz
linux-stable-9e993efb0da827634778554070f3c3ec4bdade33.tar.bz2
linux-stable-9e993efb0da827634778554070f3c3ec4bdade33.zip
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>
Diffstat (limited to 'lib')
-rw-r--r--lib/kobject.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/kobject.c b/lib/kobject.c
index f4f6176dcd12..057921c5945a 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -385,9 +385,11 @@ int kobject_move(struct kobject *kobj, struct kobject *new_parent)
goto out;
old_parent = kobj->parent;
kobj->parent = new_parent;
+ new_parent = NULL;
kobject_put(old_parent);
kobject_uevent_env(kobj, KOBJ_MOVE, envp);
out:
+ kobject_put(new_parent);
kobject_put(kobj);
kfree(devpath_string);
kfree(devpath);