kobject: free memory if netlink_kernel_create() fails

There is a kfree(ue_sk) missing on the error path if
netlink_kernel_create() fails.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Dan Carpenter 2010-05-25 11:51:10 +02:00 committed by Greg Kroah-Hartman
parent c842128607
commit 743db2d903

View File

@ -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);