Skip to content

Commit

Permalink
[PATCH] sysfs: fix a kobject leak in sysfs_add_link on the error path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Greg Kroah-Hartman committed Mar 20, 2006
1 parent 832c57e commit b322908
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/sysfs/symlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b322908

Please sign in to comment.