]> 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)
commit9bc59ea115455496c04eb199ab86f0dfe1bba295
treeb3581025a057f97b140093c84e1cf2a6e890c4e7
parent34b29b18ab1361a2c512834c3534e2a4b4193931
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 2d4cfe598 ("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