]> git.baikalelectronics.ru Git - kernel.git/commit
HID: multitouch: prevent memleak with the allocated name
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>
Wed, 29 May 2013 08:45:09 +0000 (10:45 +0200)
committerJiri Kosina <jkosina@suse.cz>
Wed, 12 Jun 2013 09:13:38 +0000 (11:13 +0200)
commit44e83605c6357e5c78ab99a2b95b9c153f410ca8
treeb3581025a057f97b140093c84e1cf2a6e890c4e7
parentf5ff685fbf1457f53be63000675a66e75df4f55d
HID: multitouch: prevent memleak with the allocated name

mt_free_input_name() was never called during .remove():
hid_hw_stop() removes the hid_input items in hdev->inputs, and so the
list is therefore empty after the call. In the end, we never free the
special names that has been allocated during .probe().

Restore the original name before freeing it to avoid acessing already
freed pointer.

This fixes a regression introduced by 184ed022b ("HID: multitouch: append " Pen" to
the name of the stylus input")

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-multitouch.c