Skip to content

Commit

Permalink
HID: wacom: check for wacom->shared before following the pointer
Browse files Browse the repository at this point in the history
486b908 (HID: wacom: do not send pen events before touch is up/forced out)
introduces a kernel oops when plugging a tablet without touch.

wacom->shared is null for these devices so this leads to a null pointer
exception.

Change the condition to make it clear that what we need is wacom->shared
not NULL.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Benjamin Tissoires authored and Jiri Kosina committed Mar 17, 2015
1 parent 9b02864 commit e2c7d88
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/hid/wacom_wac.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,11 +551,12 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
(features->type == CINTIQ && !(data[1] & 0x40)))
return 1;

if (features->quirks & WACOM_QUIRK_MULTI_INPUT)
if (wacom->shared) {
wacom->shared->stylus_in_proximity = true;

if (wacom->shared->touch_down)
return 1;
if (wacom->shared->touch_down)
return 1;
}

/* in Range while exiting */
if (((data[1] & 0xfe) == 0x20) && wacom->reporting_data) {
Expand Down

0 comments on commit e2c7d88

Please sign in to comment.