mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-22 17:01:14 +00:00
HID: wacom: fix an Oops caused by wacom_wac_finger_count_touches
We assumed all touch interfaces report touch data. But, Bamboo and Intuos non-touch devices report express keys on touch interface. We need to check touch_max before counting touches. Reported-by: Tasos Sahanidis <tasos@tasossah.com> Signed-off-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
parent
849eca7b9d
commit
26ba61f871
1 changed files with 3 additions and 0 deletions
|
@ -1072,6 +1072,9 @@ static int wacom_wac_finger_count_touches(struct wacom_wac *wacom)
|
||||||
int count = 0;
|
int count = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (!touch_max)
|
||||||
|
return 0;
|
||||||
|
|
||||||
/* non-HID_GENERIC single touch input doesn't call this routine */
|
/* non-HID_GENERIC single touch input doesn't call this routine */
|
||||||
if ((touch_max == 1) && (wacom->features.type == HID_GENERIC))
|
if ((touch_max == 1) && (wacom->features.type == HID_GENERIC))
|
||||||
return wacom->hid_data.tipswitch &&
|
return wacom->hid_data.tipswitch &&
|
||||||
|
|
Loading…
Reference in a new issue