From patchwork Thu Apr 27 11:37:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Arefev X-Patchwork-Id: 88235 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp226541vqo; Thu, 27 Apr 2023 05:21:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ71NaQ+lvzf7XKgtZFtaL9b3sOfhwNMpql5eV5xaVWCf1sIF8PhTcGEWHI94urvAbUeNpHQ X-Received: by 2002:a17:902:e805:b0:19e:7a2c:78a7 with SMTP id u5-20020a170902e80500b0019e7a2c78a7mr1737642plg.57.1682598117341; Thu, 27 Apr 2023 05:21:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682598117; cv=none; d=google.com; s=arc-20160816; b=sNnY5G43jNrH5O+fYRK5OBWHiGhcTctvuUp4StUWVxhoiRwnsHztLpXOjJ5uGEwRde VI7sjjridbdPAs4d/XiWb4uRObhpAa1jsgXcMTGgMOD3HfTtplFWx3wFFGp/95AY4B8t 6QTCcDd1LU296kw/7Uw24G15awTEDoqlZ8EZLh50MAMMjsjPpBAPtkk7FAeEvyHJrUBe 1DyVCaD6U0y0eTC53n3GVERT+xEk8JD7x1xMoLPg7bWl/pkVO2eLN6z0hDtsGhJj1R1h LHtHqct6WIgaZ9HyPdaADp17cmJ3oqCDKs1oKFN12EgXn87CixMgheuuR6I1Uj9O6ZFU 3sCw== 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=s1PcC8YbHGUhVX6wpDGxIeN9uu+XyBl1n/bu9ToljNBhvIATtftJFDXblBW/iddSPk n8yub9b0Mg2GaGItEbKxDLjKBSN2Ms9dZUIdnogjYQZajToaM5amHQNcDhbHQmoRYbOi MfEuvolyYmh28U7y/riOxK+xY3s00kR6Fbx+uUKpNCn0qOOIinqkYPqEwzUwJcGuc+Jw 72rBHyFEU1oUg3KN0Z0tvxhuQ839Xo8SnuVGdsz13JaLsGyi3+NcybwLjI0M3++bw+VV Yozff0PJPXhmkUYYiWmXbgXvpIfSp0K4tKvU3enQVptgBOZHqK6v9jdK7dPlA/k1OIJu +6UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@swemel.ru header.s=mail header.b="VnLpo/D9"; 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 x13-20020a170902a38d00b0019b354d0268si16981580pla.280.2023.04.27.05.21.44; Thu, 27 Apr 2023 05:21:57 -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="VnLpo/D9"; 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 S243551AbjD0LnS (ORCPT + 99 others); Thu, 27 Apr 2023 07:43:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243215AbjD0LnQ (ORCPT ); Thu, 27 Apr 2023 07:43:16 -0400 X-Greylist: delayed 327 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 27 Apr 2023 04:43:13 PDT Received: from mx.swemel.ru (mx.swemel.ru [95.143.211.150]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CD054C12; Thu, 27 Apr 2023 04:43:13 -0700 (PDT) From: Denis Arefev DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=swemel.ru; s=mail; t=1682595460; 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=VnLpo/D9lGIFFeTXwOFt5vZe/y6MC0ulbrm+cMyBdC4LOkh5XMPULeV9ca0nDyrJYNxs2M v6p7xchAvVMdrRN8jA5JUwcMF9c60/5zGkMVXBJi/DSkvpFuz49M9HzbVKXrBTwshtQP7+ EkiVXZgjPJKMQ3ycWgJ/pXA6GUrBLuk= To: Ping Cheng Cc: Jason Gerecke , Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, trufanov@swemel.ru, vfh@swemel.ru Subject: [PATCH] HID: wacom: Added error check Date: Thu, 27 Apr 2023 14:37:40 +0300 Message-Id: <20230427113740.52811-1-arefev@swemel.ru> MIME-Version: 1.0 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: 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?1764332003143477370?= 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 --- 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);