From b3229087c5e08589cea4f5040dab56f7dc11332a Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 16 Mar 2006 15:44:26 -0800 Subject: [PATCH] [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 --- fs/sysfs/symlink.c | 1 + 1 file changed, 1 insertion(+) 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); -- GitLab