mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@suse.de>
To: linux-kernel@vger.kernel.org
Cc: Dan Carpenter <error27@gmail.com>, Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH 2/3] kobject: free memory if netlink_kernel_create() fails
Date: Fri,  4 Jun 2010 13:47:28 -0700	[thread overview]
Message-ID: <1275684449-20061-2-git-send-email-gregkh@suse.de> (raw)
In-Reply-To: <20100604204450.GC19761@kroah.com>

From: Dan Carpenter <error27@gmail.com>

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>
---
 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 e2eb989..b935795 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);
-- 
1.7.1


  parent reply	other threads:[~2010-06-04 20:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-04 20:44 [GIT PATCH] driver core fixes for .35-git Greg KH
2010-06-04 20:47 ` [PATCH 1/3] lib/kobject_uevent.c: fix CONIG_NET=n warning Greg Kroah-Hartman
2010-06-04 20:47 ` Greg Kroah-Hartman [this message]
2010-06-04 20:47 ` [PATCH 3/3] fix setattr error handling in sysfs, configfs Greg Kroah-Hartman

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=1275684449-20061-2-git-send-email-gregkh@suse.de \
    --to=gregkh@suse.de \
    --cc=error27@gmail.com \
    --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

Powered by JetHome