diff options
author | Dan Carpenter <error27@gmail.com> | 2010-05-25 05:51:10 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-06-04 16:27:52 -0400 |
commit | 743db2d903bc4e963a31496328d847d69f75047c (patch) | |
tree | 1bd1b8eba5cf60252b00f2b3abb9edb808bb7a90 /lib | |
parent | c842128607a50a670df5f9c75261db2e21db3c45 (diff) |
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')
-rw-r--r-- | lib/kobject_uevent.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c index e2eb989d322..b93579504df 100644 --- a/lib/kobject_uevent.c +++ b/lib/kobject_uevent.c | |||
@@ -380,6 +380,7 @@ static int uevent_net_init(struct net *net) | |||
380 | if (!ue_sk->sk) { | 380 | if (!ue_sk->sk) { |
381 | printk(KERN_ERR | 381 | printk(KERN_ERR |
382 | "kobject_uevent: unable to create netlink socket!\n"); | 382 | "kobject_uevent: unable to create netlink socket!\n"); |
383 | kfree(ue_sk); | ||
383 | return -ENODEV; | 384 | return -ENODEV; |
384 | } | 385 | } |
385 | mutex_lock(&uevent_sock_mutex); | 386 | mutex_lock(&uevent_sock_mutex); |