From patchwork Fri Nov 10 16:13:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 163868 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp1297863vqs; Fri, 10 Nov 2023 10:18:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IEdwUlWdeuCMEmlQ5HPrDWffOE+mZiBQNytyEHI0pthxFO89uwBUAbX45CZWhW7LkpAESaY X-Received: by 2002:a17:90b:33c7:b0:27d:1f9f:a57f with SMTP id lk7-20020a17090b33c700b0027d1f9fa57fmr5823988pjb.32.1699640294277; Fri, 10 Nov 2023 10:18:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699640294; cv=pass; d=google.com; s=arc-20160816; b=0hQL1URTXhghKbZFe5JU9iCXlr7aBdOzUc0ylItFqalfpHe+gP3st/RBQhibCTIJGx EvMfMBJIEJ2SffhOTPm7BNSH9okQCsRp5WxxGO3z3qG7+CV82vI+op+AHNoRyH/b6qnq 81B//J8+Jxg2BDKNnI42DqdeTxzyTIQNsm+16li8ROV0VY8/O0K8gkX4c2g5g6EotDeA n+yxna4xioTu9dPUH+qOvEOGi9/muVpnlnIh3rDVX/Tceg0GmD3reBIxtO5r01066YRY CoJCsKyjsSMF4jUxPv9x87ydbj3irkE3CetAcC8BaMmNjL1K1AROlqCAEpmj373ZCqI2 dhXQ== 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:cc:to :content-language:subject:from:user-agent:date:message-id :dkim-signature; bh=pcX2jxt4x2Vxyw76+dm9r0oMksDBreswRcx/5GtG6oU=; fh=Bh1tED8A02xIKs8YFveLxnppusWRExcSyo6FWFzkBL4=; b=MCWBWX0Gk1gTGttJTKS6w5mlHJcCbcPgaAzVpe14Ytj7TJz4RdB1USXUFF/6VUFmXR BTR7N39CipMzVO3e4MKbq091p1eKPOdPjY+YBe9VCh4oGZdIyI7WfwQIcOd4YQRO3RPU 2654enMXOtfEnNSFiy5ueT/wBzsnBf6cwYAU4grj/wsR1vAMSwGd6C+mYcTHuDtb7qYb BpBuQQCLxCACdEz94SwZNY1g0s9uNroABxEolYkFWzj9lp3hmTucSceYD1dLAOCn5PhF 9xIgSmLZVoXUhZEYIskM5CkNRdoRGaCwNSiX/XhswKh5986VbUwJBVoL1mTiqWipWe/F WjZA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=yynuzWO9; arc=pass (i=1 spf=pass spfdomain=siemens.com dkim=pass dkdomain=siemens.com dmarc=pass fromdomain=siemens.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=siemens.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id 5-20020a17090a198500b00282ecb475b6si35762pji.174.2023.11.10.10.18.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Nov 2023 10:18:14 -0800 (PST) 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=@siemens.com header.s=selector2 header.b=yynuzWO9; arc=pass (i=1 spf=pass spfdomain=siemens.com dkim=pass dkdomain=siemens.com dmarc=pass fromdomain=siemens.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=siemens.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 968F983B8437; Fri, 10 Nov 2023 10:17:38 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344853AbjKJSRZ (ORCPT + 30 others); Fri, 10 Nov 2023 13:17:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235719AbjKJSO5 (ORCPT ); Fri, 10 Nov 2023 13:14:57 -0500 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2054.outbound.protection.outlook.com [40.107.22.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8099E3C6D8; Fri, 10 Nov 2023 08:13:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b4lkLyf2863DVeiu1Tzo3lnEnuosagKKUWdl/k3fm47YcCebr63Hq0onRZo/skecLYbKJbdX/AY5h9i1XaKG+KYiydI4E186Gqg2UOW5GqcBYo7DxFP2ec9Q3VQU7jgXZdWT+/rC97jSvfsUdlqNA9fDFwSjzMGdBGHJproXIUEuh3ZoZdNNWyGHJCsAa7lfZj98pR04KnRAiOBhPQ+JBit+1fso2tEjetdkZdpEF94dH7oPb4R8XFwCKx/91UWKOGt2lbUfeBRVyLAhJyl1oVuQt4dlwieuf4YTDD1Du8nLvTmBE55J/ELUmFbd12PYVVe5gW22rx+Hh0vioBeQnA== 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=pcX2jxt4x2Vxyw76+dm9r0oMksDBreswRcx/5GtG6oU=; b=V9WmOHY6+k7SAg5Iu+J2PKV1nLgZDkJkyR/00REffoLg86zujukf8JnzUmf87C0b2tLaLtXSsVSlTEXP5L0oocQGkbZA7lmSyfXmmLHec4ljrFFmJRoTqhxy6Qcfz3lUnj89GqMfzkPq5LgYGTFWY3rYrUpq3ldYjWq219g977gaP1Oqo4IuPEf9eqscMEuCF/UqdvRcm2M7JgtQKTXrQ6RtBZ2thMjN5y850lXod2AMG6kDKvWVb5gAZH9GfI8uSiTKQJSqFRhzTZH1ulVnRswHEbhMLNSQL/6S885GmiRm8idJNw3FkIaBJPntvF5ShIRTxt+RTBQfc4+waM5teQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=siemens.com; dmarc=pass action=none header.from=siemens.com; dkim=pass header.d=siemens.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=siemens.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pcX2jxt4x2Vxyw76+dm9r0oMksDBreswRcx/5GtG6oU=; b=yynuzWO9afb5krF+OXZBHMcq4ayMJqph3WS3KWHgiRL+JlpJR9EqsEtS7ouQC1Px4sHuNt2wv75pvX1xP4tAtPWFiCPoT+CsY96r/t5KaS94HPFU8otNfXjvgnCpRXT+85NSIAM8Ei7Eo4km9dx3GgkYVR4gLe6qtxDELxXAxVjBJ5qVjZSQUw94G9YJzazJSVjZ7/Pbl9WEdYz3WcePqxzWrr+rZCWWYJzsgjumQ5BW1W9u9bB5DUgqPm5b+dRAx+FXWXOre2zVHRg9KdgvEf3e34Th8U5B54Jiem66H3nRdbqZabqnGK3dl5ddeIS7Aq9Exu5DfmNHyA3DitR+QQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=siemens.com; Received: from AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:588::19) by AS8PR10MB7970.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:568::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.18; Fri, 10 Nov 2023 16:13:09 +0000 Received: from AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM ([fe80::96c7:d239:1723:8761]) by AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM ([fe80::96c7:d239:1723:8761%4]) with mapi id 15.20.6977.018; Fri, 10 Nov 2023 16:13:08 +0000 Message-ID: <7a4e5c5b-e397-479b-b1cb-4b50da248f21@siemens.com> Date: Fri, 10 Nov 2023 17:13:02 +0100 User-Agent: Mozilla Thunderbird From: Jan Kiszka Subject: [PATCH net v4] net: ti: icssg-prueth: Add missing icss_iep_put to error path Content-Language: en-US To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , MD Danish Anwar Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Lopes Ivo, Diogo Miguel (T CED IFD-PT)" , Nishanth Menon , "Su, Bao Cheng (RC-CN DF FA R&D)" , Wojciech Drewek , Roger Quadros X-ClientProxiedBy: CH0PR04CA0010.namprd04.prod.outlook.com (2603:10b6:610:76::15) To AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:588::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS4PR10MB6181:EE_|AS8PR10MB7970:EE_ X-MS-Office365-Filtering-Correlation-Id: 5d61adc4-56d7-49d6-68fd-08dbe207eded X-LD-Processed: 38ae3bcd-9579-4fd4-adda-b42e1495d55a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MsaB1bqxNDxFIfZxPkbpWW5tJQQ7Hu8YxQRo8Bui7PAFq+UU4+9GEwR2yPPMcbomKB8WoTZ0NbbUJgE0hwV1AKptUhlgzYrtWI+r9yu++9Kw8Hz9J1WuPtTuwmuvIWIZYhhg2E8DBquhu6zD3MDd836J0Kq/jPCbQP1jhX1hlUfmSZxTfhF1kOccWggPFsd4FIGB8Swqui1zyNPIOxfXOKqVsn5Le/3rbdGz1bBjFFssMTeDQOziFTrOtKzqnvyYgBRbjJKJOEqYLY/tojfY9W9jaXUZrAEcGBcu1Etn19MnOxRYwniA4gW1MmilaUa0dRIU4qQjpBErSDt1bZt8lSVcNWemttdqfoXz/HXtzb0McmakCZWeW6+uZ2MFxF6zJwo25/dh/PyeR0DJmQI+Bn/O741pPtop0jNSTeQ2EsAQj7VDXSik9BDApEHOzuqGW+9oTyGO6hv00+ObjUCF8Al5s8wa/gQHgRGcHRaPlI/VCnxHFgzqfm6g/Vp503X3KLTyjQciUk2CJ+xQCkEWcx65vPfr/YssODs3JE0jajuDzpJaWua9uvfKxc05Atds9vdnepV84MObVLtEaKURQc8OFlYC9VXcN5IFH9zcc25AEAy6PEdww9//OSXJewiHoqeN8ZQ3eypyxAzO1zxV+g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230031)(366004)(346002)(396003)(39860400002)(136003)(376002)(230922051799003)(186009)(451199024)(64100799003)(1800799009)(83380400001)(26005)(82960400001)(2616005)(44832011)(6512007)(38100700002)(6506007)(31686004)(478600001)(66476007)(6666004)(110136005)(66946007)(54906003)(316002)(66556008)(36756003)(41300700001)(2906002)(4326008)(6486002)(8676002)(8936002)(5660300002)(7416002)(86362001)(31696002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?KnFjkJr9DUradQYCkSIwuf86JvQA?= =?utf-8?q?Xd0b/k+1AdVqulG+C2zgpBsPrffgfQEtlZWt5OmS5wP/Sx5BMjYCfdtjCFyGwDVSY?= =?utf-8?q?wdXWoax99c9xAcmHpX5RO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zHZQe92Cx7IVQ0Ipl1d69yIaW9zAw07?= =?utf-8?q?sVkivpU+yQwxcAZA1nQuqZcLqabeBnM7EOxYMLNaWhbCrK9fH3FBQOowwBlewcbzh?= =?utf-8?q?7a4rjEqSRNyclutC/kO9CAIU3CcURyqR5xxFy6CxPYDptS2J2BWfaVlLpY+3KFqix?= =?utf-8?q?Zd1hERc/xhESEhx/3sx+ApKV+KqU+4WJ9QaWsJ0+gJtkgEWU6Suel9LEDrXkrvowe?= =?utf-8?q?Xqw3VF1k/PYvnEqT+p22oB+isYbc7ZDmgSM3++1XHTzENiaQJ4oUvYUvRLHf55VYa?= =?utf-8?q?0aWqBziDxqXwNcs8K/eAnm/em9ewAyOvvSqucceYPo4i5FeaKUzSexWfLqWZ6sxV1?= =?utf-8?q?5ToYEzafaw381GGEY47L2nxqPA1gsvAUoBI8aEAZnuWZy+KWtoCvY+PnlvsiiGbKI?= =?utf-8?q?zlQbJTd0gN9WFn2X6qZhgoVgkcyWeZZDZjSmLNsbCwCL+/BoQuk3nYYR12Wg5Lq+F?= =?utf-8?q?eCumj3UQt4bammDUft9Pav+MuwDRrwYkFRZoDIluxG1l0DpuasACarCmdVqGMWv4w?= =?utf-8?q?IdRkxuFHvsdZcYCoAXvCE8NLGAW6ejNE4w=3D=3D?= X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5d61adc4-56d7-49d6-68fd-08dbe207eded X-MS-Exchange-CrossTenant-AuthSource: AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2023 16:13:08.9324 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: nPWZmJPhT+Dubzb43REXMi6BF23DfgijG+MhH4uxaPxvQ9Jo66sbQw3BemEvZoekX3kL9uucuq6ybzdxzRuLWw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR10MB7970 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, 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, T_SCC_BODY_TEXT_LINE 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: 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]); Fri, 10 Nov 2023 10:17:38 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782202021295751692 X-GMAIL-MSGID: 1782202021295751692 From: Jan Kiszka Analogously to prueth_remove, just also taking care for NULL'ing the iep pointers. Fixes: 186734c15886 ("net: ti: icssg-prueth: add packet timestamping and ptp support") Fixes: 443a2367ba3c ("net: ti: icssg-prueth: am65x SR2.0 add 10M full duplex support") Signed-off-by: Jan Kiszka Reviewed-by: Wojciech Drewek Reviewed-by: MD Danish Anwar Reviewed-by: Roger Quadros --- Changes in v4: - no functional ones - added one original author in CC with new address (no address of Grygorii available) Changes in v3: - consolidate cleanup logic further [Wojciech] - make sure to NULL iep pointers Changes in v2: - add proper tags This was lost from the TI SDK version while ripping out SR1.0 support - which we are currently restoring for upstream. drivers/net/ethernet/ti/icssg/icssg_prueth.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth.c b/drivers/net/ethernet/ti/icssg/icssg_prueth.c index 6c4b64227ac8..3abbeba26f1b 100644 --- a/drivers/net/ethernet/ti/icssg/icssg_prueth.c +++ b/drivers/net/ethernet/ti/icssg/icssg_prueth.c @@ -2105,10 +2105,7 @@ static int prueth_probe(struct platform_device *pdev) prueth->iep1 = icss_iep_get_idx(np, 1); if (IS_ERR(prueth->iep1)) { ret = dev_err_probe(dev, PTR_ERR(prueth->iep1), "iep1 get failed\n"); - icss_iep_put(prueth->iep0); - prueth->iep0 = NULL; - prueth->iep1 = NULL; - goto free_pool; + goto put_iep0; } if (prueth->pdata.quirk_10m_link_issue) { @@ -2205,6 +2202,12 @@ static int prueth_probe(struct platform_device *pdev) exit_iep: if (prueth->pdata.quirk_10m_link_issue) icss_iep_exit_fw(prueth->iep1); + icss_iep_put(prueth->iep1); + +put_iep0: + icss_iep_put(prueth->iep0); + prueth->iep0 = NULL; + prueth->iep1 = NULL; free_pool: gen_pool_free(prueth->sram_pool,