From: Axel Lin <axel.lin@gmail.com>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: Tejun Heo <tj@kernel.org>,
David Brownell <dbrownell@users.sourceforge.net>,
Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH] dmi-id: fix a memory leak in dmi_id_init error path
Date: Thu, 01 Jul 2010 10:35:07 +0800 [thread overview]
Message-ID: <1277951707.30073.5.camel@mola> (raw)
This patch adds a missing kfree(dmi_dev) in dmi_id_init error path.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/firmware/dmi-id.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/firmware/dmi-id.c b/drivers/firmware/dmi-id.c
index a777a35..94a58a0 100644
--- a/drivers/firmware/dmi-id.c
+++ b/drivers/firmware/dmi-id.c
@@ -229,10 +229,12 @@ static int __init dmi_id_init(void)
ret = device_register(dmi_dev);
if (ret)
- goto fail_class_unregister;
+ goto fail_free_dmi_dev;
return 0;
+fail_free_dmi_dev:
+ kfree(dmi_dev);
fail_class_unregister:
class_unregister(&dmi_class);
--
1.5.4.3
next reply other threads:[~2010-07-01 2:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-01 2:35 Axel Lin [this message]
2010-07-02 7:05 ` Tejun Heo
2010-07-03 1:59 ` Greg KH
2010-07-08 16:09 ` patch "dmi-id: fix a memory leak in dmi_id_init error path" added to gregkh-2.6 tree gregkh
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=1277951707.30073.5.camel@mola \
--to=axel.lin@gmail.com \
--cc=dbrownell@users.sourceforge.net \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@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®