HID: elan: Fix memleak in elan_input_configured
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Mon, 31 Aug 2020 09:06:43 +0000 (17:06 +0800)
committerJiri Kosina <jkosina@suse.cz>
Tue, 1 Sep 2020 07:11:24 +0000 (09:11 +0200)
commitb7429ea53d6c0936a0f10a5d64164f0aea440143
tree9cfe864249a487a7d27e47da36d3c3e3e0145fa2
parent724a419ea28f7514a391e80040230f69cf626707
HID: elan: Fix memleak in elan_input_configured

When input_mt_init_slots() fails, input should be freed
to prevent memleak. When input_register_device() fails,
we should call input_mt_destroy_slots() to free memory
allocated by input_mt_init_slots().

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-elan.c