linux/drivers/hid
Jason Gerecke a9ce7856ca HID: wacom: Fix sibling detection regression
Commit 345857b ("HID: wacom: generic: Add support for sensor offsets") included
a change to the operation and location of the call to 'wacom_add_shared_data'
in 'wacom_parse_and_register'. The modifications included moving it higher up
so that it would occur before the call to 'wacom_retrieve_hid_descriptor'. This
was done to prevent a crash that would have occured when the report containing
tablet offsets was fed into the driver with 'wacom_hid_report_raw_event'
(specifically: the various 'wacom_wac_*_report' functions were written with the
assumption that they would only be called once tablet setup had completed;
'wacom_wac_pen_report' in particular dereferences 'shared' which wasn't yet
allocated).

Moving the call to 'wacom_add_shared_data' effectively prevented the crash but
also broke the sibiling detection code which assumes that the HID descriptor
has been read and the various device_type flags set.

To fix this situation, we restore the original 'wacom_add_shared_data'
operation and location and instead implement an alternative change that can
also prevent the crash. Specifically, we notice that the report functions
mentioned above expect to be called only for input reports.  By adding a check,
we can prevent feature reports (such as the offset report) from
causing trouble.

Fixes: 345857bb49 ("HID: wacom: generic: Add support for sensor offsets")
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Tested-by: Ping Cheng <pingc@wacom.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-01-19 14:19:25 +01:00
..
i2c-hid HID: i2c-hid: Add sleep between POWER ON and RESET 2017-01-11 21:55:35 +01:00
intel-ish-hid Merge branches 'for-4.10/asus', 'for-4.10/cp2112', 'for-4.10/i2c-hid-nopower', 'for-4.10/intel-ish', 'for-4.10/mayflash', 'for-4.10/microsoft-surface-3', 'for-4.10/multitouch', 'for-4.10/sony', 'for-4.10/udraw-ps3', 'for-4.10/upstream' and 'for-4.10/wacom/generic' into for-linus 2016-12-14 10:12:26 +01:00
usbhid HID: usbhid: Add quirk for Mayflash/Dragonrise DolphinBar. 2017-01-02 13:20:54 +01:00
Kconfig Merge branches 'for-4.10/asus', 'for-4.10/cp2112', 'for-4.10/i2c-hid-nopower', 'for-4.10/intel-ish', 'for-4.10/mayflash', 'for-4.10/microsoft-surface-3', 'for-4.10/multitouch', 'for-4.10/sony', 'for-4.10/udraw-ps3', 'for-4.10/upstream' and 'for-4.10/wacom/generic' into for-linus 2016-12-14 10:12:26 +01:00
Makefile Merge branches 'for-4.10/asus', 'for-4.10/cp2112', 'for-4.10/i2c-hid-nopower', 'for-4.10/intel-ish', 'for-4.10/mayflash', 'for-4.10/microsoft-surface-3', 'for-4.10/multitouch', 'for-4.10/sony', 'for-4.10/udraw-ps3', 'for-4.10/upstream' and 'for-4.10/wacom/generic' into for-linus 2016-12-14 10:12:26 +01:00
hid-a4tech.c
hid-alps.c Merge branches 'for-4.8/upstream-fixes', 'for-4.9/alps', 'for-4.9/hid-input', 'for-4.9/intel-ish', 'for-4.9/kye-uclogic-waltop-fixes', 'for-4.9/logitech', 'for-4.9/sony', 'for-4.9/upstream' and 'for-4.9/wacom' into for-linus 2016-10-07 09:59:48 +02:00
hid-apple.c HID: add usb device id for Apple Magic Keyboard 2016-07-11 17:41:31 +02:00
hid-appleir.c
hid-asus.c HID: asus: Fix keyboard support 2016-12-19 11:27:09 +01:00
hid-aureal.c
hid-axff.c
hid-belkin.c
hid-betopff.c
hid-cherry.c
hid-chicony.c
hid-cmedia.c
hid-core.c HID: ignore Petzl USB headlamp 2017-01-05 14:28:32 +01:00
hid-corsair.c HID: corsair: fix control-transfer error handling 2017-01-13 11:59:32 +01:00
hid-cp2112.c HID: cp2112: add IRQ chip handling 2016-11-28 14:45:15 +01:00
hid-cypress.c HID: hid-cypress: validate length of report 2017-01-06 16:06:43 +01:00
hid-debug.c
hid-dr.c Revert "HID: dragonrise: fix HID Descriptor for 0x0006 PID" 2016-10-10 10:52:01 +02:00
hid-elecom.c
hid-elo.c HID: elo: kill not flush the work 2016-06-01 14:08:17 +02:00
hid-emsff.c
hid-ezkey.c
hid-gaff.c
hid-gembird.c
hid-generic.c
hid-gfrm.c
hid-gt683r.c
hid-gyration.c
hid-holtek-kbd.c
hid-holtek-mouse.c
hid-holtekff.c
hid-hyperv.c
hid-icade.c
hid-ids.h HID: ignore Petzl USB headlamp 2017-01-05 14:28:32 +01:00
hid-input.c Merge branches 'for-4.10/asus', 'for-4.10/cp2112', 'for-4.10/i2c-hid-nopower', 'for-4.10/intel-ish', 'for-4.10/mayflash', 'for-4.10/microsoft-surface-3', 'for-4.10/multitouch', 'for-4.10/sony', 'for-4.10/udraw-ps3', 'for-4.10/upstream' and 'for-4.10/wacom/generic' into for-linus 2016-12-14 10:12:26 +01:00
hid-kensington.c
hid-keytouch.c
hid-kye.c HID: kye: Fix MousePen i608X v2 report descriptor 2016-09-19 14:32:22 +02:00
hid-lcpower.c
hid-led.c HID: hid-led: fix issue with transfer buffer not being dma capable 2016-10-10 10:47:03 +02:00
hid-lenovo.c HID: lenovo: Don't use stack variables for DMA buffers 2016-03-29 15:39:36 +02:00
hid-lg.c HID: lg: make transfer buffers DMA capable 2016-11-23 17:42:43 +01:00
hid-lg.h
hid-lg2ff.c
hid-lg3ff.c
hid-lg4ff.c HID: hid-logitech: Improve Wingman Formula Force GP support 2016-09-26 15:39:56 +02:00
hid-lg4ff.h HID: hid-logitech: Add combined pedal support Logitech wheels 2016-09-26 15:39:54 +02:00
hid-lgff.c
hid-logitech-dj.c
hid-logitech-hidpp.c
hid-magicmouse.c HID: magicmouse: make transfer buffers DMA capable 2016-11-23 17:43:25 +01:00
hid-mf.c HID: Add new force feedback driver for Mayflash game controller adapters 2016-11-03 14:51:29 -06:00
hid-microsoft.c Merge branches 'for-4.10/asus', 'for-4.10/cp2112', 'for-4.10/i2c-hid-nopower', 'for-4.10/intel-ish', 'for-4.10/mayflash', 'for-4.10/microsoft-surface-3', 'for-4.10/multitouch', 'for-4.10/sony', 'for-4.10/udraw-ps3', 'for-4.10/upstream' and 'for-4.10/wacom/generic' into for-linus 2016-12-14 10:12:26 +01:00
hid-monterey.c
hid-multitouch.c Merge branches 'for-4.10/asus', 'for-4.10/cp2112', 'for-4.10/i2c-hid-nopower', 'for-4.10/intel-ish', 'for-4.10/mayflash', 'for-4.10/microsoft-surface-3', 'for-4.10/multitouch', 'for-4.10/sony', 'for-4.10/udraw-ps3', 'for-4.10/upstream' and 'for-4.10/wacom/generic' into for-linus 2016-12-14 10:12:26 +01:00
hid-ntrig.c
hid-ortek.c
hid-penmount.c
hid-petalynx.c
hid-picolcd.h
hid-picolcd_backlight.c
hid-picolcd_cir.c
hid-picolcd_core.c
hid-picolcd_debugfs.c
hid-picolcd_fb.c
hid-picolcd_lcd.c
hid-picolcd_leds.c
hid-pl.c
hid-plantronics.c
hid-primax.c
hid-prodikeys.c
hid-rmi.c HID: rmi: make transfer buffers DMA capable 2016-11-23 17:43:25 +01:00
hid-roccat-arvo.c
hid-roccat-arvo.h
hid-roccat-common.c
hid-roccat-common.h
hid-roccat-isku.c
hid-roccat-isku.h
hid-roccat-kone.c
hid-roccat-kone.h
hid-roccat-koneplus.c
hid-roccat-koneplus.h
hid-roccat-konepure.c
hid-roccat-kovaplus.c
hid-roccat-kovaplus.h
hid-roccat-lua.c
hid-roccat-lua.h
hid-roccat-pyra.c
hid-roccat-pyra.h
hid-roccat-ryos.c
hid-roccat-savu.c
hid-roccat-savu.h
hid-roccat.c HID: roccat: silence an uninitialized variable warning 2016-04-04 09:49:12 +02:00
hid-saitek.c HID: Add a new Saitek mouse device ID (RAT 9) 2016-08-02 16:45:17 +02:00
hid-samsung.c
hid-sensor-custom.c HID: sensor: fix attributes in HID sensor interface 2016-11-05 16:56:09 +01:00
hid-sensor-hub.c HID: sensor-hub: Move the memset to sensor_hub_get_feature() 2017-01-02 14:01:30 +01:00
hid-sjoy.c
hid-sony.c HID: sony: Ignore DS4 dongle reports when no device is connected 2016-12-19 15:07:37 +01:00
hid-speedlink.c
hid-steelseries.c
hid-sunplus.c
hid-tivo.c
hid-tmff.c
hid-topseed.c
hid-twinhan.c
hid-uclogic.c HID: uclogic: Add support for UC-Logic TWHA60 v3 2016-09-19 14:32:24 +02:00
hid-udraw-ps3.c HID: udraw-ps3: accel_limits is local to the driver 2016-11-15 14:23:17 +01:00
hid-waltop.c HID: Remove broken links to tablet descriptions 2016-09-19 14:32:21 +02:00
hid-wiimote-core.c
hid-wiimote-debug.c
hid-wiimote-modules.c HID: wiimote: Fix wiimote mp scale linearization 2016-03-18 17:31:38 +01:00
hid-wiimote.h
hid-xinmo.c
hid-zpff.c
hid-zydacron.c
hidraw.c Merge branch 'for-4.7/upstream' into for-linus 2016-05-17 12:41:22 +02:00
uhid.c miscdevice: Add helper macro for misc device boilerplate 2016-08-31 14:12:35 +02:00
wacom.h HID: wacom: generic: Don't return a value for wacom_wac_event 2016-12-09 13:26:24 +01:00
wacom_sys.c HID: wacom: Fix sibling detection regression 2017-01-19 14:19:25 +01:00
wacom_wac.c HID: wacom: Fix sibling detection regression 2017-01-19 14:19:25 +01:00
wacom_wac.h HID: wacom: generic: Don't sync input on empty input packets 2016-12-09 13:26:25 +01:00