From: Dmitriy Monakhov Date: Sat, 3 Mar 2007 13:11:21 +0000 (+0300) Subject: kobject: new_device->kref wasn't putted after error in kobject_move() X-Git-Tag: v2.6.21-rc4~52^2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=9e993efb0da827634778554070f3c3ec4bdade33;p=linux-2.6-omap-h63xx.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/lib/kobject.c b/lib/kobject.c index f4f6176dcd1..057921c5945 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);