Skip to content

Commit

Permalink
kobject: free memory if netlink_kernel_create() fails
Browse files Browse the repository at this point in the history
There is a kfree(ue_sk) missing on the error path if
netlink_kernel_create() fails.

Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: "Eric W. Biederman" <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
error27 authored and gregkh committed Jun 4, 2010
1 parent c842128 commit 743db2d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/kobject_uevent.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ static int uevent_net_init(struct net *net)
if (!ue_sk->sk) {
printk(KERN_ERR
"kobject_uevent: unable to create netlink socket!\n");
kfree(ue_sk);
return -ENODEV;
}
mutex_lock(&uevent_sock_mutex);
Expand Down

0 comments on commit 743db2d

Please sign in to comment.