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: https://git.stricted.de/?a=commitdiff_plain;h=b3229087c5e08589cea4f5040dab56f7dc11332a;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.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);