HID: elan: Fix potential double free in elan_input_configured
stable inclusion from stable-v5.10.121 commit 6d0726725c7c560495f5ff364862a2cefea542e3 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I5L6CQ Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=6d0726725c7c560495f5ff364862a2cefea542e3 -------------------------------- [ Upstream commit 1af20714 ] '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: b7429ea5 ("HID: elan: Fix memleak in elan_input_configured") Fixes: 9a6a4193 ("HID: Add driver for USB ELAN Touchpad") Signed-off-by: NMiaoqian Lin <linmq006@gmail.com> Acked-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: NJiri Kosina <jkosina@suse.cz> Signed-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com> Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
Showing
想要评论请 注册 或 登录