From: Dan Carpenter <error27@gmail.com>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>,
"David S. Miller" <davem@davemloft.net>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] kobject: free memory if netlink_kernel_create() fails
Date: Tue, 25 May 2010 11:51:10 +0200 [thread overview]
Message-ID: <20100525095110.GG22515@bicker> (raw)
There is a kfree(ue_sk) missing on the error path if
netlink_kernel_create() fails.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index 59c1551..08e15f7 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -378,6 +378,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);
next reply other threads:[~2010-05-25 9:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-25 9:51 Dan Carpenter [this message]
2010-05-25 10:25 ` [patch] kobject: free memory if netlink_kernel_create() fails Eric W. Biederman
2010-05-26 7:43 ` David Miller
2010-05-26 14:35 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100525095110.GG22515@bicker \
--to=error27@gmail.com \
--cc=davem@davemloft.net \
--cc=ebiederm@xmission.com \
--cc=gregkh@suse.de \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox