[PATCH] sysfs: fix a kobject leak in sysfs_add_link on the error path
authorGreg Kroah-Hartman <gregkh@suse.de>
Thu, 16 Mar 2006 23:44:26 +0000 (15:44 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 20 Mar 2006 21:42:59 +0000 (13:42 -0800)
As pointed out by Oliver Neukum.

Cc: Maneesh Soni <maneesh@in.ibm.com>
Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/sysfs/symlink.c

index fe23f47f6e430c19f0ac3b57f4603200723195a6..d2eac3ceed5f31cf9735a68ecc69dc4a6c6771ed 100644 (file)
@@ -66,6 +66,7 @@ static int sysfs_add_link(struct dentry * parent, const char * name, struct kobj
        if (!error)
                return 0;
 
+       kobject_put(target);
        kfree(sl->link_name);
 exit2:
        kfree(sl);