linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@gmail.com>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: Miloslav Trmac <mitr@volny.cz>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Rakib Mullick <rakib.mullick@gmail.com>, TJ <ubuntu@tjworld.net>,
	Julia Lawall <julia@diku.dk>,
	Samu Onkalo <samu.p.onkalo@nokia.com>,
	linux-input@vger.kernel.org
Subject: [PATCH] wistron_btns: fix a memory leak in wb_module_init error path
Date: Mon, 28 Jun 2010 14:30:20 +0800	[thread overview]
Message-ID: <1277706620.4148.2.camel@mola> (raw)

select_keymap calls copy_keymap to allocate a memory for keymap.
This patch adds a missing kfree(keymap) in wb_module_init error path.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/input/misc/wistron_btns.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/input/misc/wistron_btns.c b/drivers/input/misc/wistron_btns.c
index 4dac8b7..55ce70e 100644
--- a/drivers/input/misc/wistron_btns.c
+++ b/drivers/input/misc/wistron_btns.c
@@ -1371,6 +1371,7 @@ static int __init wb_module_init(void)
 	platform_driver_unregister(&wistron_driver);
  err_unmap_bios:
 	unmap_bios();
+	kfree(keymap);
 
 	return err;
 }
-- 
1.5.4.3




             reply	other threads:[~2010-06-28  6:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-28  6:30 Axel Lin [this message]
2010-06-28  8:02 ` [PATCH] wistron_btns: fix a memory leak in wb_module_init error path Dmitry Torokhov

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=1277706620.4148.2.camel@mola \
    --to=axel.lin@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=julia@diku.dk \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mitr@volny.cz \
    --cc=rakib.mullick@gmail.com \
    --cc=samu.p.onkalo@nokia.com \
    --cc=ubuntu@tjworld.net \
    /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;
as well as URLs for NNTP newsgroup(s).