HID: lenovo-tpkbd: Fix memory leak in tpkbd_remove_tp()
PATCH 1/1 HID: lenovo-tpkbd: Fix memory leak in tpkbd_remove_tp()
We need to kfree names for led_mute and led_micmute in tpkbd_remove_tp().
Signed-off-by Axel Lin <[email protected]>
--- drivers/hid/hid-lenovo-tpkbd.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/hid/hid-lenovo-tpkbd.c +2 -0
@@ -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); }
Signature · 1 line
1.7.9.5
Quoted 4 lines · On Thu, 13 Sep 2012 13:25:12 +0800 Axel Lin <[email protected]> wrote:
We need to kfree names for
led_muteandled_micmuteintpkbd_remove_tp().Signed-off-by Axel Lin <[email protected]>
Acked-by Bernhard Seibold <[email protected]>
Quoted 17 lines
--- drivers/hid/hid-lenovo-tpkbd.c | 2 ++ 1 file changed, 2 insertions(+)(quoted diff) +0
-0
b/drivers/hid/hid-lenovo-tpkbd.cindex 77d2df0..60c4e1e 100644drivers/hid/hid-lenovo-tpkbd.c +2
-0@@ -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); }
Jiri Kosina
AppliedQuoted 9 lines · Bernhard Seibold
Quoted 4 lines · On Thu, 13 Sep 2012 13:25:12 +0800 Axel Lin <[email protected]> wrote:
We need to kfree names for
led_muteandled_micmuteintpkbd_remove_tp().Signed-off-by Axel Lin <[email protected]>Acked-by Bernhard Seibold <[email protected]>
Applied, thanks.
Quoted 18 lines
Quoted 17 lines
--- drivers/hid/hid-lenovo-tpkbd.c | 2 ++ 1 file changed, 2 insertions(+)(quoted diff) +0
-0
b/drivers/hid/hid-lenovo-tpkbd.cindex 77d2df0..60c4e1e 100644drivers/hid/hid-lenovo-tpkbd.c +2
-0@@ -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); }
Signature · 2 lines
Jiri Kosina SUSE Labs