mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jike Song <albcamus@gmail.com>
To: gregkh@suse.de
Cc: linux-kernel@vger.kernel.org, huangweibing@gmail.com,
	Jike Song <albcamus@gmail.com>
Subject: [PATCH] driver core: fix possible memory leak in bus_register()
Date: Thu, 15 Jul 2010 17:43:54 +0800	[thread overview]
Message-ID: <1279187034-11826-1-git-send-email-albcamus@gmail.com> (raw)

Reported-by: huangweibing@gmail.com
Signed-off-by: Jike Song <albcamus@gmail.com>
---
 drivers/base/bus.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 12eec3f..eb1b7fa 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -945,8 +945,8 @@ bus_devices_fail:
 	bus_remove_file(bus, &bus_attr_uevent);
 bus_uevent_fail:
 	kset_unregister(&bus->p->subsys);
-	kfree(bus->p);
 out:
+	kfree(bus->p);
 	bus->p = NULL;
 	return retval;
 }
-- 
1.6.4.GIT


                 reply	other threads:[~2010-07-15  9:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1279187034-11826-1-git-send-email-albcamus@gmail.com \
    --to=albcamus@gmail.com \
    --cc=gregkh@suse.de \
    --cc=huangweibing@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

all inboxes | Powered by JetHome®