Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e2c7d887 authored by Benjamin Tissoires's avatar Benjamin Tissoires Committed by Jiri Kosina
Browse files

HID: wacom: check for wacom->shared before following the pointer



486b908d (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: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 9b028649
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -551,11 +551,12 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
	   (features->type == CINTIQ && !(data[1] & 0x40)))
	   (features->type == CINTIQ && !(data[1] & 0x40)))
		return 1;
		return 1;


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


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


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