linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: wacom: Don't add ghost interface as shared data
@ 2017-03-29 17:35 Aaron Armstrong Skomra
  2017-03-30  9:31 ` Jiri Kosina
  0 siblings, 1 reply; 2+ messages in thread
From: Aaron Armstrong Skomra @ 2017-03-29 17:35 UTC (permalink / raw)
  To: linux-input, jkosina, pinglinux, killertofu
  Cc: linux-kernel, Aaron Armstrong Skomra, stable # 4 . 9,
	Aaron Armstrong Skomra

A previous commit (below) adds a check for already probed interfaces to
Wacom's matching heuristic. Unfortunately this causes the Bamboo Pen
(CTL-460) to match itself to its 'ghost' touch interface. After
subsequent changes to the driver this match to the ghost causes the
kernel to crash. This patch avoids calling wacom_add_shared_data()
for the BAMBOO_PEN's ghost touch interface.

Fixes: 41372d5d40e7 ("HID: wacom: Augment 'oVid' and 'oPid' with heuristics for HID_GENERIC")
Cc: stable <stable@vger.kernel.org>     # 4.9
Signed-off-by: Aaron Armstrong Skomra <aaron.skomra@wacom.com>
---
 drivers/hid/wacom_sys.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index 5e7a5648e708..0c535d0f3b95 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -2017,6 +2017,14 @@ static int wacom_parse_and_register(struct wacom *wacom, bool wireless)
 
 	wacom_update_name(wacom, wireless ? " (WL)" : "");
 
+	/* pen only Bamboo neither support touch nor pad */
+	if ((features->type == BAMBOO_PEN) &&
+	    ((features->device_type & WACOM_DEVICETYPE_TOUCH) ||
+	    (features->device_type & WACOM_DEVICETYPE_PAD))) {
+		error = -ENODEV;
+		goto fail;
+	}
+
 	error = wacom_add_shared_data(hdev);
 	if (error)
 		goto fail;
@@ -2064,14 +2072,6 @@ static int wacom_parse_and_register(struct wacom *wacom, bool wireless)
 		goto fail_quirks;
 	}
 
-	/* pen only Bamboo neither support touch nor pad */
-	if ((features->type == BAMBOO_PEN) &&
-	    ((features->device_type & WACOM_DEVICETYPE_TOUCH) ||
-	    (features->device_type & WACOM_DEVICETYPE_PAD))) {
-		error = -ENODEV;
-		goto fail_quirks;
-	}
-
 	if (features->device_type & WACOM_DEVICETYPE_WL_MONITOR)
 		error = hid_hw_open(hdev);
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] HID: wacom: Don't add ghost interface as shared data
  2017-03-29 17:35 [PATCH] HID: wacom: Don't add ghost interface as shared data Aaron Armstrong Skomra
@ 2017-03-30  9:31 ` Jiri Kosina
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2017-03-30  9:31 UTC (permalink / raw)
  To: Aaron Armstrong Skomra
  Cc: linux-input, pinglinux, killertofu, linux-kernel,
	Aaron Armstrong Skomra

On Wed, 29 Mar 2017, Aaron Armstrong Skomra wrote:

> A previous commit (below) adds a check for already probed interfaces to
> Wacom's matching heuristic. Unfortunately this causes the Bamboo Pen
> (CTL-460) to match itself to its 'ghost' touch interface. After
> subsequent changes to the driver this match to the ghost causes the
> kernel to crash. This patch avoids calling wacom_add_shared_data()
> for the BAMBOO_PEN's ghost touch interface.
> 
> Fixes: 41372d5d40e7 ("HID: wacom: Augment 'oVid' and 'oPid' with heuristics for HID_GENERIC")
> Cc: stable <stable@vger.kernel.org>     # 4.9
> Signed-off-by: Aaron Armstrong Skomra <aaron.skomra@wacom.com>

Applied to for-4.11/upstream-fixes.

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-30  9:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-29 17:35 [PATCH] HID: wacom: Don't add ghost interface as shared data Aaron Armstrong Skomra
2017-03-30  9:31 ` Jiri Kosina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).