summaryrefslogtreecommitdiffstats
path: root/lib/kobject_uevent.c
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-05-25 11:51:10 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2010-06-04 22:27:52 +0200
commit743db2d903bc4e963a31496328d847d69f75047c (patch)
tree1bd1b8eba5cf60252b00f2b3abb9edb808bb7a90 /lib/kobject_uevent.c
parentlib/kobject_uevent.c: fix CONIG_NET=n warning (diff)
downloadlinux-743db2d903bc4e963a31496328d847d69f75047c.tar.xz
linux-743db2d903bc4e963a31496328d847d69f75047c.zip
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>
Diffstat (limited to 'lib/kobject_uevent.c')
-rw-r--r--lib/kobject_uevent.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index e2eb989d3223..b93579504dfa 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -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);