]> git.baikalelectronics.ru Git - kernel.git/commit
HID: logitech-hidpp: disable io in probe error path
authorPeter Wu <peter@lekensteyn.nl>
Thu, 11 Dec 2014 12:51:20 +0000 (13:51 +0100)
committerJiri Kosina <jkosina@suse.cz>
Thu, 11 Dec 2014 22:10:01 +0000 (23:10 +0100)
commit9e5c506e1ef8ef69d3296236dbd9d722fc8a4b13
tree531578461e529eddb5522c92796420f68b2a4154
parent543acc2a24c9f1e39a28254be7d5b1f723457f86
HID: logitech-hidpp: disable io in probe error path

Balance a hid_device_io_start() call with hid_device_io_stop() in the
error path. This avoids processing of HID reports when the probe fails
which possibly leads to invalid memory access in hid_device_probe() as
report_enum->report_id_hash might already be freed via
hid_close_report().

hid_set_drvdata() is called before wtp_allocate, be consistent and clear
drvdata too on the error path of wtp_allocate.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-logitech-hidpp.c