From: Greg Kroah-Hartman Date: Thu, 16 Mar 2006 23:44:26 +0000 (-0800) Subject: [PATCH] sysfs: fix a kobject leak in sysfs_add_link on the error path X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b3229087c5e08589cea4f5040dab56f7dc11332a;p=openwrt%2Fstaging%2Fblogic.git [PATCH] sysfs: fix a kobject leak in sysfs_add_link on the error path As pointed out by Oliver Neukum. Cc: Maneesh Soni Cc: Oliver Neukum Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c index fe23f47f6e43..d2eac3ceed5f 100644 --- a/fs/sysfs/symlink.c +++ b/fs/sysfs/symlink.c @@ -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);