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-Tag: v2.6.17-rc1~1177^2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=b3229087c5e08589cea4f5040dab56f7dc11332a;p=linux-2.6-omap-h63xx.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 fe23f47f6e4..d2eac3ceed5 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);