Message ID | 20230427114745.53136-1-arefev@swemel.ru |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp217251vqo; Thu, 27 Apr 2023 05:07:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5xuuQ8qZPH5eCK5dDj5hk0qGq3qjV7T9TP79nIjJYRee/mhAEWmWkvYMQCd36cOpUE+g2m X-Received: by 2002:a05:6a20:914f:b0:ef:8de0:6a5 with SMTP id x15-20020a056a20914f00b000ef8de006a5mr2305813pzc.3.1682597270270; Thu, 27 Apr 2023 05:07:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682597270; cv=none; d=google.com; s=arc-20160816; b=H7XpsgfxXwJ7iX2kBSfpnzXpzOlLasItER8JCCiw/iodIKElGJYEOpUmMLiSTDKA9e 5XIJAt8Nxif6hbfcB7QdchjdNMRYSMX5h2BaeYj/JRfK+QfZozbs6Qu8Z+8X+N8GBcUj D0m4eDTxSrfjfvgNYQ7aPOdj+qY1PjJsJ9H/vN6dEi9DcMDh/iOmud6LOO8EyWL/V9Tj br1MSrhJdhRDuz0E8RT35uqIpW6RQddZVHNvBjoCsDGDVuZLWix4w9k0XweDLXbLYwUM Ae7cRXGxu7zp0bLYTzBw/nccqy7HCMtvsNAglKLwnVCbf6qwFWpzen2Yqxi7UEbtLX8+ 4Gxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:dkim-signature:from; bh=BPz+sCdj0zEEm34nzbfMEWWZqvUZAC80l+biy0y2rpg=; b=oUtlP4kAYsKen9e1rc4ayAtUDv9DIffuzUduHorIRxQ1h1MDu0w5dkNRUgG1KYnk7Z y2nEnzNO4QBBBeWIaRgxpAwBZRkWJ2YSwsGtEz7VcclXfYzZoGifQ838ppL1PTk4Paf/ ZE4dFLORYDJ8NO3mbEXVLBEEWq/b8LAt0uuAgV86eSTLi6L3HaiptTOMkkpKzGLtMCFr WIszLevXyqpiONUy0tocnZLt4YoGt5xIMp6VbXiZE17P+Jsk2GEHCfLnSsyzirzLJpkP ds3ABAUz+AAj/sG+gIrqeuvKANzVBFhcwW4UUMBiPxiVDraxSNTQz4iEfOD27p9wmBLM rPJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@swemel.ru header.s=mail header.b=XY9Uqjkv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=swemel.ru Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bk13-20020a056a02028d00b0050bef774fbfsi15605498pgb.838.2023.04.27.05.07.33; Thu, 27 Apr 2023 05:07:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@swemel.ru header.s=mail header.b=XY9Uqjkv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=swemel.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243372AbjD0Lry (ORCPT <rfc822;zxc52fgh@gmail.com> + 99 others); Thu, 27 Apr 2023 07:47:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243492AbjD0Lrw (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 27 Apr 2023 07:47:52 -0400 Received: from mx.swemel.ru (mx.swemel.ru [95.143.211.150]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15E85E7; Thu, 27 Apr 2023 04:47:49 -0700 (PDT) From: Denis Arefev <arefev@swemel.ru> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=swemel.ru; s=mail; t=1682596065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=BPz+sCdj0zEEm34nzbfMEWWZqvUZAC80l+biy0y2rpg=; b=XY9UqjkvFlyevL4fYzw6AZpw2XsfcMue5NcxP/+4Fx+s4rqkxDlQl19tW1Tg6Cm6nkQMJt qgyB33ESgGLKCJ+4VRZhqBt2xJY4N7zLnl6IXYEGLGkH/XxDxN58zjFS8o6NBfjpld8ocv sz3/Jej09teSGb0MtLyFcaXPqnKWqJ8= To: Ping Cheng <ping.cheng@wacom.com> Cc: Jason Gerecke <jason.gerecke@wacom.com>, Jiri Kosina <jikos@kernel.org>, Benjamin Tissoires <benjamin.tissoires@redhat.com>, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org, trufanov@swemel.ru, vfh@swemel.ru Subject: [PATCH] HID: wacom: Added error check Date: Thu, 27 Apr 2023 14:47:45 +0300 Message-Id: <20230427114745.53136-1-arefev@swemel.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764331115462458026?= X-GMAIL-MSGID: =?utf-8?q?1764331115462458026?= |
Series |
HID: wacom: Added error check
|
|
Commit Message
Denis Arefev
April 27, 2023, 11:47 a.m. UTC
Added a variable check and
transition in case of an error
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Denis Arefev <arefev@swemel.ru>
---
drivers/hid/wacom_sys.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
Comments
On Thu, Apr 27, 2023 at 5:07 AM Denis Arefev <arefev@swemel.ru> wrote: > > Added a variable check and > transition in case of an error > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Signed-off-by: Denis Arefev <arefev@swemel.ru> Thank you Denis for working on the patch! The patch LGTM. Reviewed-by: Ping Cheng <ping.cheng@wacom.com> Cheers, Ping > --- > drivers/hid/wacom_sys.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c > index fb538a6c4add..aff4a21a46b6 100644 > --- a/drivers/hid/wacom_sys.c > +++ b/drivers/hid/wacom_sys.c > @@ -2417,8 +2417,13 @@ static int wacom_parse_and_register(struct wacom *wacom, bool wireless) > goto fail_quirks; > } > > - if (features->device_type & WACOM_DEVICETYPE_WL_MONITOR) > + if (features->device_type & WACOM_DEVICETYPE_WL_MONITOR) { > error = hid_hw_open(hdev); > + if (error) { > + hid_err(hdev, "hw open failed\n"); > + goto fail_quirks; > + } > + } > > wacom_set_shared_values(wacom_wac); > devres_close_group(&hdev->dev, wacom); > -- > 2.25.1 >
On Thu, 27 Apr 2023, Denis Arefev wrote: > Added a variable check and > transition in case of an error > > Found by Linux Verification Center (linuxtesting.org) with SVACE. Applied, thanks.
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c index fb538a6c4add..aff4a21a46b6 100644 --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c @@ -2417,8 +2417,13 @@ static int wacom_parse_and_register(struct wacom *wacom, bool wireless) goto fail_quirks; } - if (features->device_type & WACOM_DEVICETYPE_WL_MONITOR) + if (features->device_type & WACOM_DEVICETYPE_WL_MONITOR) { error = hid_hw_open(hdev); + if (error) { + hid_err(hdev, "hw open failed\n"); + goto fail_quirks; + } + } wacom_set_shared_values(wacom_wac); devres_close_group(&hdev->dev, wacom);