Skip to content

Commit

Permalink
HID: lenovo-tpkbd: Fix memory leak in tpkbd_remove_tp()
Browse files Browse the repository at this point in the history
We need to kfree names for led_mute and led_micmute in tpkbd_remove_tp().

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Bernhard Seibold <mail@bernhard-seibold.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
AxelLin authored and Jiri Kosina committed Sep 22, 2012
1 parent 5b6e7f1 commit 3914998
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/hid/hid-lenovo-tpkbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 3914998

Please sign in to comment.