]> git.baikalelectronics.ru Git - kernel.git/commit
HID: elan: Fix potential double free in elan_input_configured
authorMiaoqian Lin <linmq006@gmail.com>
Sat, 16 Apr 2022 07:37:21 +0000 (07:37 +0000)
committerJiri Kosina <jkosina@suse.cz>
Thu, 21 Apr 2022 09:38:28 +0000 (11:38 +0200)
commit0b2f65d044e624583c855f7b54a3662e5ff2c446
tree614364f9b462e9ddb7607521108e15b71e74481b
parent1642e326b90ef8240c3a9c63e2e81633b1d3c949
HID: elan: Fix potential double free in elan_input_configured

'input' is a managed resource allocated with devm_input_allocate_device(),
so there is no need to call input_free_device() explicitly or
there will be a double free.

According to the doc of devm_input_allocate_device():
 * Managed input devices do not need to be explicitly unregistered or
 * freed as it will be done automatically when owner device unbinds from
 * its driver (or binding fails).

Fixes: 23390174ef11 ("HID: elan: Fix memleak in elan_input_configured")
Fixes: 4557f5fd7a27 ("HID: Add driver for USB ELAN Touchpad")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-elan.c