From patchwork Mon Sep 18 04:13:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Rameshbabu X-Patchwork-Id: 13388793 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC5A8CD13D9 for ; Mon, 18 Sep 2023 04:15:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239538AbjIREPG (ORCPT ); Mon, 18 Sep 2023 00:15:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239512AbjIREOj (ORCPT ); Mon, 18 Sep 2023 00:14:39 -0400 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2055.outbound.protection.outlook.com [40.107.212.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF615C6; Sun, 17 Sep 2023 21:14:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MX1VGqdqdnndUryxNZxQrCz41WPJDQ7M5E0FOBctU7wxYFM98bWK5COBzjMAD72qJjUAagocr0Ki8bfwt3HNi4NAp0qvGNCCD0BC9YhUu/5/AJyHrd+SRopHMvCztKoOpemFh7pG6h6EaYLHjNmk5hjzPvJNkclkOcZJJLYkKG1tPEl3ZNdqPpabNIQ0xnp0TjXdrkLwCf8TczILdsCWAEiiUPJK/wJQOorI8e0E+bMakVKBbmCWO/1CCJucrlgh9pV895ZzjyYWdLvUpxdmZ4S0e4AHydctZbFVGEPaNN1p5392XT6AAbLI8VUpuTneFOpeVrH0dmeOBHQxc/Xgpw== 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=DDkAfZKRnYEYRLCh+DVXLuzacnaY5ysTyeoTP8bolCY=; b=OeUFfSe9dtaohXWCg1wrE0WbPz8UP0KRhwVLoUPQNSrQhhiHgAblEqLrNuqCaYu1J2or6j7D8A/A5i7CYtzf1nut5XxDM117m1oEryLMSrMUYeYgx13KJAyKOo5aDtWP16uSHtB+fGxFTJwzFHWpiXiKr4SSBhCevD6fM88Z1wMLlxu/kfZXVbo7Rwl+lgGWd1K+lSfkjleoh2/pQGmlvHaAnXXfRCN73FmokgOsp2ptyXW/BXdzBEiHUzfgYdaPCgub9uEASLnxF4T2YaKIdIJZUsvb0C2mlGSiovstjwPTorI8ndh82VK9rzJbBDdrog7h/qcnu4kAeuEyjDSkjg== 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=DDkAfZKRnYEYRLCh+DVXLuzacnaY5ysTyeoTP8bolCY=; b=J6aFPoIQA6v3fI6o2odCFRxWfUq6N7nz3J3+EJN2j5z9xiVQyM6QQO2YINO3TVTb5HBWbmsktEJ9S1/HpnfAM+38nleAQ9Q+4ly9kPwgxWS/c4tDM8aJajyzHrBfH2243PmElPpYzurIfNL0ycuGYD/OxeTYuaEdmfYtvRfRqf1vN/6NunrDC/TGZeh6hymiTFemdQSK/IJw68uQ4Tdqi8BQjG3jsZHmcwAipkOSNozhQfZTTEE8GMpSknYyXRo8sUKS2X2p20WC88LECBpDKsBsvtqyz0/1JsBh82oa8/PimdfF+6dUTxPU2PKysh+HzpnOwEN/itXJmQeihdXDRw== 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 SA1PR12MB5658.namprd12.prod.outlook.com (2603:10b6:806:235::5) 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 04:14:28 +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 04:14:28 +0000 From: Rahul Rameshbabu To: Jiri Kosina , Benjamin Tissoires Cc: Christophe JAILLET , kernel-janitors@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Rahul Rameshbabu Subject: [PATCH v2 2/3] HID: nvidia-shield: Fix some missing function calls() in the probe error handling path Date: Sun, 17 Sep 2023 21:13:44 -0700 Message-Id: <20230918041345.59859-3-rrameshbabu@nvidia.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918041345.59859-1-rrameshbabu@nvidia.com> References: <20230918041345.59859-1-rrameshbabu@nvidia.com> X-ClientProxiedBy: SJ0PR03CA0073.namprd03.prod.outlook.com (2603:10b6:a03:331::18) To BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR12MB2743:EE_|SA1PR12MB5658:EE_ X-MS-Office365-Filtering-Correlation-Id: 0fc52610-ffda-402b-6c2c-08dbb7fdc03b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RA6CBe2zyDJThg1+mFse+qAXFzlNboKD5S/UGkJPArJY8odND57pDcpiBhKXl7uHf26iVZu7PQQNNW9AIuQ41vBnb+tgMPEAiMhRvsaiajLPf6g2kJNSLayFY51D3DF2yWxhpLoRoB6hM2aMrRKvIwbIObjhCVxvwrR0fYsg/TBtYzAIUa1XvkHalReDDwHeDVc/KLuQBZlsozDRCUD/wTydS6IIf42tABmVWTUESRxnxYVcmOekxh90N81aOlSeXywj015Lr0ao1Uic/Q9Us4X4wUsajIgH/mbiZlTQJyfIW0cR3BfL7tIVX1UDvLsfi6yfMRRRov8MpUMA/C2Ca/4wf9pFUXWWIUiaHjedwG9SUrsD16qLSg498X7eoNMBphYV7j/thn5P9x7wkZ4sCNRXR2IuIwUMiBksR4msv5TAbPC+ffKKHYB65+zZQ+BMCQu/8Cd760f/tZpEKF0AWkiyY9ooGAb5BDft5yh2s+epY9/uuL5/xhGIvusOquJUT8/692scB3pIyf3tssO9FXc1zwG509lrzfdV4w20h3oQ1Q+K80ZV4bgDXKZrNbvk 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)(136003)(39860400002)(376002)(396003)(366004)(346002)(451199024)(1800799009)(186009)(6486002)(5660300002)(6506007)(86362001)(6512007)(54906003)(316002)(66946007)(41300700001)(38100700002)(66556008)(66476007)(110136005)(6666004)(478600001)(2616005)(8936002)(8676002)(26005)(2906002)(36756003)(107886003)(1076003)(4326008)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: LrOWrlG6qVhqMxEwgYFIw3LbIyZKdU3lMSoETLL10vWCBYLaTjta4bY0BPOsaE8l46K8E0owMekM/ESzV7VmGGGpSidq9IhfEe+D5407NwFCwNI2U0cLV6c+8f7+JBf/Ze7eIpWYk6+Rbsv+CBmluSa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ldYuoirgTrdXm3Tcc8dKr6RHIGl0VIXR9plKRAr0DnKHqVsulFOuf92P1nf4iFt0Sd0EdXsywyUmOnP3xjlEby17S5aLv75rF+uRhOLhbFKhHjKNCWw+Xvuar1e2s9x2mm6fiKdC6WrCI42HP/4Cq52nSTwPZKTtFXQuSO/ecoBME6rMKMG2FGLnA8Z/h42BAN3FCNx8mo6/ZBJ2/xErs3frTIk4Pl5Bb6uoFlygRilypINdsi3SmsLji+xuBKZQTOrxNg0r6n5E8dLQOXvp/D+WMEYF41pEA77a7hJheowCBTqzCYR40l305QjmHF0Cqn+Sb3HSQuUDFc2zJ9BNBHudFSoV47i19E4EmeTUow X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0fc52610-ffda-402b-6c2c-08dbb7fdc03b X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB2743.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2023 04:14:28.4003 (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: 6fqbvQ5MGM3AD/y1ghNjhIaXDaPdWEDYPZ7Fz7jgElRRwYF/47iNVAPEZZpfj+iGxbwkFDb1Bim35ZRYv0QlOQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB5658 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Christophe JAILLET 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 Reviewed-by: Rahul Rameshbabu --- Notes: Changes: v1->v2: - Rename err_haptics label to err_ts_create to make the label name more accurate. 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; }