From: Axel Lin <axel.lin@gmail.com>
To: Jiri Kosina <jkosina@suse.cz>
Cc: Bernhard Seibold <mail@bernhard-seibold.de>, linux-input@vger.kernel.org
Subject: [PATCH] HID: lenovo-tpkbd: Fix memory leak in tpkbd_remove_tp()
Date: Thu, 13 Sep 2012 13:25:12 +0800 [thread overview]
Message-ID: <1347513912.3319.1.camel@phoenix> (raw)
We need to kfree names for led_mute and led_micmute in tpkbd_remove_tp().
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/hid/hid-lenovo-tpkbd.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/hid/hid-lenovo-tpkbd.c b/drivers/hid/hid-lenovo-tpkbd.c
index 77d2df0..60c4e1e 100644
--- a/drivers/hid/hid-lenovo-tpkbd.c
+++ b/drivers/hid/hid-lenovo-tpkbd.c
@@ -519,6 +519,8 @@ static void tpkbd_remove_tp(struct hid_device *hdev)
led_classdev_unregister(&data_pointer->led_mute);
hid_set_drvdata(hdev, NULL);
+ kfree(data_pointer->led_micmute.name);
+ kfree(data_pointer->led_mute.name);
kfree(data_pointer);
}
--
1.7.9.5
next reply other threads:[~2012-09-13 5:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-13 5:25 Axel Lin [this message]
2012-09-14 9:35 ` [PATCH] HID: lenovo-tpkbd: Fix memory leak in tpkbd_remove_tp() Bernhard Seibold
2012-09-17 10:56 ` Jiri Kosina
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=1347513912.3319.1.camel@phoenix \
--to=axel.lin@gmail.com \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
--cc=mail@bernhard-seibold.de \
/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).