[v3,2/3] HID: nvidia-shield: Fix some missing function calls() in the probe error handling path
Message ID | 20230918115432.30076-3-rrameshbabu@nvidia.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2605022vqi; Mon, 18 Sep 2023 05:08:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG+Ay2VK0ozy7+1S+hL3wAc1EPOglX64qSC5LD2wXzExg79wp+0pHMNfCU+29smr+otPHTn X-Received: by 2002:a05:6a20:3d1b:b0:153:8983:d87c with SMTP id y27-20020a056a203d1b00b001538983d87cmr17560851pzi.22.1695038917859; Mon, 18 Sep 2023 05:08:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1695038917; cv=pass; d=google.com; s=arc-20160816; b=MBs2GSf8+DzUlwkcs0DzB54Kof9YKb8Y0Lrl4jrCFms9wKI5NtSCT3YFnPS/caTSRi Gp2/sMKJqew+uF0+vQ8iyMHnNVAzNEdoeZCxLQuzE5lwkzaWbiHxVai2czghKZnbpBLZ H4SoTMQYGtD0pREoMLKwjOGuHD6pBP8qVoez3/LY9a5d+HKP9z7bkH+u7N1PDZb4R2ke OuIs4lj545zLBeGEeblcNqDAQfpxRYqnUEG5RKW2sDJPju3/nthpM8EzYza8RwWN0JYd 1NE/XI+HyYxBVdkAMfgpf97zv+Ds6dgeO6nhnVW9kaGqSY1MJtcvShvRtkLtDKi0UJnC ItWw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=W1FIBDQHRoSpuV6r0BPeSdALbquX/AvwUSU51/p7reo=; fh=SikQoJLNpGF0HeiQJkcbVWYlrNXIBKXrenHYWqn1frM=; b=OO4ZOSJGYigLYCgeeJGpBNCMAd9hbPZnCgZHYFqbfmMzNt5hA6hpfmPNEYLRf7cSY6 OSCOT6UkFQRf9bSUtbYRIhdpLWBxLH1Svy03jLkmDKMeuLiBRlEmRK1lncZxePBrCV18 FQt3MOTOtxpJYZnTjLov/vl5SD+SO8cH7+TLFqkraWna6twKikbOVvn0PssVE8AhvfDi VY+6uJmzYzE8yGA13H8ik1go983TmBqr26T2DkA7YPLfqVZDs7NEOx3Z6EoXbt7eGWVm iT6ompDA4Vs+dUWQh6AyCa9M1HnilQuKOhVKysi6wecrwsJQKX3h5vjEtz8ejtBh0EoC Fr3w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=XfJiihrS; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id m124-20020a632682000000b00565f8b22ca3si7557052pgm.38.2023.09.18.05.08.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 05:08:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=XfJiihrS; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 1CD5B819FC44; Mon, 18 Sep 2023 04:59:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241825AbjIRL7F (ORCPT <rfc822;kernel.ruili@gmail.com> + 27 others); Mon, 18 Sep 2023 07:59:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241883AbjIRL6q (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 18 Sep 2023 07:58:46 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2057.outbound.protection.outlook.com [40.107.220.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5F7E172A; Mon, 18 Sep 2023 04:55:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QJmio5g+/675efPyfwqRx7G1Xco5WarcTBrZdrEijqQKPGV6Zq6E52TtT4r/6zaCqShAEFGgTWG0RlOMjFQsMsafrtvcaJP5zVybSTVRf5zAA07ZKJLaUO3KrM/F463qIioFtKU/ALV2OZ8j2sW68MT0XQB/9PL/SCJAonbQjGNnk1v93+Zdlo5ugvEig3OoIAEXvnngUBcIKjxQzmHZUHZf8Fqk4P1gfdoXGXoSvPe2Yz3r6tpmRc5TlEhBdZ3bTsn9NTJKqh2ta9Ov3Bl6qOJb8oX+6FwPToj1QJZozvM2c7pWdva1ZaoRrJmTy+DRUE2mRuwkFJzpPsXEkalMoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=W1FIBDQHRoSpuV6r0BPeSdALbquX/AvwUSU51/p7reo=; b=QKgsEEiRJbFq6OXN7/4mh+B9NyvfzuFtYXw5hKGGyQrq/o9pvAzVOA/OeRpA0+nrhYDldA3ZGRaVL+FdP5NUxzl6yPOidKTrgn1o/XEbq7P3iW76mmc3DKT3w0eb+EiMvVpK3Q5i/vffdydGsyy5YpeRxD5EXOI0l+eBKBowq5pkBx33GioGVCd4OjlFRb2n5gpDh3gwRTtfyjoQ1/fU6OF5zUcO4YuaqO7Xq4W7ev+7YGiJPurOQCo2vBZK8eAPbRMxg9lZ4jbRcYLF2zc/tfbemkg7cnHJKXcKMJDWOlWUjihRpHuTc2bojg9jqa2Va6W5IVO2iincjB0psAdgrQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=W1FIBDQHRoSpuV6r0BPeSdALbquX/AvwUSU51/p7reo=; b=XfJiihrSZ9Q6zqLhp9u+qCLQkX60xvUlA669aw0DF67AL4/MahhiKSdO+elVqBsmTeW/xlnh53jf9ty7eyUs+RLaxlMO3HJVGSRel4qvT31nXDJyc9+y1qY5jxYYeMWgx+IRIfVGV+WA7euS+k09VJWg74Az1keMYrTOZNyThiS0/9xfyJFm+CVRRliW1oEJRsGZPp7RDmWCF60MGm2WEDO1SjqwJ7+G342KqdTthad/R2CjJNeWNUpi9u7umYG3XuKd2FKMcWtpxBVaxZNqoSnhB1sJwONun+Rhz9c8I+tZsSGYZvMSzHIrlQOfE4uMxjwBSm/BH3ybFS1/ecszVA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) by PH7PR12MB7872.namprd12.prod.outlook.com (2603:10b6:510:27c::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.26; Mon, 18 Sep 2023 11:54:48 +0000 Received: from BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::5cc1:1ea3:4ec5:72af]) by BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::5cc1:1ea3:4ec5:72af%5]) with mapi id 15.20.6792.026; Mon, 18 Sep 2023 11:54:48 +0000 From: Rahul Rameshbabu <rrameshbabu@nvidia.com> To: Jiri Kosina <jikos@kernel.org>, Benjamin Tissoires <benjamin.tissoires@redhat.com> Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>, kernel-janitors@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Rahul Rameshbabu <rrameshbabu@nvidia.com> Subject: [PATCH v3 2/3] HID: nvidia-shield: Fix some missing function calls() in the probe error handling path Date: Mon, 18 Sep 2023 04:54:31 -0700 Message-Id: <20230918115432.30076-3-rrameshbabu@nvidia.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918115432.30076-1-rrameshbabu@nvidia.com> References: <20230918115432.30076-1-rrameshbabu@nvidia.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: BYAPR06CA0010.namprd06.prod.outlook.com (2603:10b6:a03:d4::23) To BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR12MB2743:EE_|PH7PR12MB7872:EE_ X-MS-Office365-Filtering-Correlation-Id: b7f7b288-a7fb-4a71-5902-08dbb83e0f4a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OFOp9re/m2sPvJlxuAomrgU/9lIKv2mDwo3exW5MzFXelKtwrRTlKblvVi+EP8mfrQIXuuwSx4wcoE6Rkrx7kux0sR2fnlKuJ4zPqVrceCJbNLXzm+D+PdVEA925Z1A5XqSHjPDo7oezqcGfspy/4tUkTZcScWsnugDRETy66jWkKLn6405XUMpge/7ztkYltrfs4bXcaYDyH5/JR/LcJRCxaacy9+jOZYw59SF7QDFwYnj4XcqZyVew1MYAS7tOEc/kH/YlCe3BSUHQI0mNgXHKKzGiKAJ0dFZho6EX6QAzluxSF5aFEOhv6TScbkca+/PPTJmofuBxl4EOq2ELlvr+WzQGqyu5g4rx6aqWTm927r4SBBm55aiUdFeUzWxa4JcOR5bP0xjynbPeLDAHm8tvRKpiphA+/VuBP5qpnLgRpx+JeJpkCRDaak7w6B0JM6QLaFVdnngTIj7jvWQBwv1T023r0UnsAm6/mjINkweb2JKk+R2pRGa1F9QNJH/ZywK8aoTO7/Q17OwvHiQcLb/b1h5yF5F3vPmGx3TnDx1rw96sPRNnQIMFlF1HOGFi X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB2743.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(366004)(136003)(376002)(39860400002)(346002)(1800799009)(186009)(451199024)(26005)(2616005)(8936002)(8676002)(1076003)(4326008)(107886003)(83380400001)(2906002)(36756003)(5660300002)(86362001)(6506007)(6486002)(478600001)(6666004)(316002)(54906003)(6512007)(110136005)(66946007)(66476007)(41300700001)(66556008)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: eDs26dqn7doqk0toQLfXaZ2E9t6weLsN9Ar4CD11PZ4esAt249Uk/8lnm8CJ03JOYAMTAtAXiiGzA4gZfbePWaRuFhx4z7ST+zQqhg9yAagE6D+Tz1/zCtctm/b4/gm4y1vMiACIoKN7Unedcb/2sm+o2MUGRE5/JSNMnqcT50kZPQi4I2c+4j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8wR0QmW+7eZAOvhJuHNFAEaY+fBqbuPbrdjeB6h5KhN+r1mSHsOE4hHYF/Kwmf2Sa99SDIvpaasDZcyyOXdkYj7jrAjL8Ep7AsmmX6p8oE5mozQwIyJcEelQIQx6cjdBGxpdSmsODIU6vtCmAMVCarTgg+oDtaIAZ1oq8BpYpiYTEisAiCeVhYsJvVdFA4DETTQgWXp6T3V5zUxQg6eLAtB9s+574ffrKO1kAWEKBSlkcs8+tlm9loAo8HhYNEHuXSKjk2+2A2Nyd8xF4fCKG4FGNKrBijh/HRsyNG10fi6z5Z4sbf4eFEZijVdicKA7CRaUlwrbobtFQc6q8Cd6FgjgHUpkQ2CoQH6gCXwAsJCRg== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: b7f7b288-a7fb-4a71-5902-08dbb83e0f4a X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB2743.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2023 11:54:48.8007 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5Q0xgGsITfuATYXjlSMmJcziB5WFxKCu0y3+isQ8yW9p9fjwo9jZlpHVhr52o2ap8jc6YTAFL0nsx9yQpif6Qg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7872 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=no 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 18 Sep 2023 04:59:32 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777377128318275067 X-GMAIL-MSGID: 1777377128318275067 |
Series |
HID: nvidia-shield: Fix the error handling path of shield_probe()
|
|
Commit Message
Rahul Rameshbabu
Sept. 18, 2023, 11:54 a.m. UTC
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr> The commit in Fixes updated the error handling path of thunderstrike_create() and the remove function but not the error handling path of shield_probe(), should an error occur after a successful thunderstrike_create() call. Add the missing calls. Fixes: 3ab196f88237 ("HID: nvidia-shield: Add battery support for Thunderstrike") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Rahul Rameshbabu <rrameshbabu@nvidia.com> --- Notes: Changes: v1->v2: - Rename err_haptics label to err_ts_create to make the label name more accurate. v2->v3: - No changes. drivers/hid/hid-nvidia-shield.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/hid/hid-nvidia-shield.c b/drivers/hid/hid-nvidia-shield.c index c144641452d3..a566f9cdc97d 100644 --- a/drivers/hid/hid-nvidia-shield.c +++ b/drivers/hid/hid-nvidia-shield.c @@ -1058,7 +1058,7 @@ static int shield_probe(struct hid_device *hdev, const struct hid_device_id *id) ret = hid_hw_start(hdev, HID_CONNECT_HIDINPUT); if (ret) { hid_err(hdev, "Failed to start HID device\n"); - goto err_haptics; + goto err_ts_create; } ret = hid_hw_open(hdev); @@ -1073,10 +1073,12 @@ static int shield_probe(struct hid_device *hdev, const struct hid_device_id *id) err_stop: hid_hw_stop(hdev); -err_haptics: +err_ts_create: + power_supply_unregister(ts->base.battery_dev.psy); if (ts->haptics_dev) input_unregister_device(ts->haptics_dev); led_classdev_unregister(&ts->led_dev); + ida_free(&thunderstrike_ida, ts->id); return ret; }