From patchwork Wed Mar 29 17:35:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Armstrong Skomra X-Patchwork-Id: 9652037 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B4344602C8 for ; Wed, 29 Mar 2017 17:36:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACC462029B for ; Wed, 29 Mar 2017 17:36:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A094C24151; Wed, 29 Mar 2017 17:36:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 210A72029B for ; Wed, 29 Mar 2017 17:36:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753839AbdC2Rg6 (ORCPT ); Wed, 29 Mar 2017 13:36:58 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:34526 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753828AbdC2Rg5 (ORCPT ); Wed, 29 Mar 2017 13:36:57 -0400 Received: by mail-pg0-f68.google.com with SMTP id o123so3561969pga.1; Wed, 29 Mar 2017 10:36:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=OcrYCOw4iT68m2AmocsTLAzBBcsRa1mNIgHcv+utrlo=; b=GGkP9R0vFM+mxaBWDNzZSlCqZGYXrbw2CvVVeiT2Dg2yfM14Vo+WHJm5kxBD095Jdj +W8n0t7MXmkOrWsSktdnCLz63nec6NyU0zWwhX2k9VD7qYsTIZ/OOz0LtCnGpjSNVPwS mdBa3Q9xCVkBehMp8EfgSGZt+e23+stJmmgXqTUIlSeOc4HwBkQSvJBaUOIOnpuD9p5l IApah2ZkPtSbyhdgzG6Seoo14Q0+rURU70LKgbtrTr8BlWy8qf2KIZRJFgD6p8re7/Eq 3NMCs3E20ZEpwko80TFemOIXu0NqOiupaEls2BF9zGpwBu+a+HPAhb1wA6lsXxQJ64Yg 55Fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=OcrYCOw4iT68m2AmocsTLAzBBcsRa1mNIgHcv+utrlo=; b=oN3aipbyaEePGckinmMXkT+Scaty8iqnG/7gSYkWWnn/zbdKqtxToo0CeS17R0afdU ixcRqzWJliVNgehQt6FAyu3MDryI6/ds8h1vf2iq2Pupz1i4rMiYghArGNJd6U9AhaDF ZdkaLPl0UTFtmDaFcFbNp3oaYGGeMlAWcRkVw5ob/Q2tV4Iecprtxa0LJxkE+Unnwfst zTh7vnE9tC+hVp2pwxmWxC0WzcafDIMYCuY2lkPZp8tN0c1wok+XZHsnib4tljkc8AcI EkcfJ2cAvEeChQpU9K2vOuNXedz0kqM7dfbds2uBwvCU1b8ewh2e2OOxy9awYTIDRZU+ Ow6A== X-Gm-Message-State: AFeK/H2g/F3EgvQNf6PIQC9ehX0Wbme/sKVnmxkeNp7ZsFh/Z/WAhPGjjlZAwUsLVKsSZw== X-Received: by 10.84.130.99 with SMTP id 90mr1977485plc.94.1490809016010; Wed, 29 Mar 2017 10:36:56 -0700 (PDT) Received: from localhost.localdomain (75-164-129-33.ptld.qwest.net. [75.164.129.33]) by smtp.googlemail.com with ESMTPSA id i81sm14788504pfi.23.2017.03.29.10.36.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Mar 2017 10:36:55 -0700 (PDT) From: Aaron Armstrong Skomra To: linux-input@vger.kernel.org, jkosina@suse.cz, pinglinux@gmail.com, killertofu@gmail.com Cc: linux-kernel@vger.kernel.org, Aaron Armstrong Skomra , "stable # 4 . 9" , Aaron Armstrong Skomra Subject: [PATCH] HID: wacom: Don't add ghost interface as shared data Date: Wed, 29 Mar 2017 10:35:39 -0700 Message-Id: <1490808939-22398-1-git-send-email-skomra@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 # 4.9 Signed-off-by: Aaron Armstrong Skomra --- 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);