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: 13452515 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A90C1DDD1 for ; Fri, 10 Nov 2023 16:13:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=siemens.com header.i=@siemens.com header.b="yynuzWO9" 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) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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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3hsHFP6swIiLIf3+lVaGmFw?= =?utf-8?q?IavLqM2SZLzxl81yml+6jEf5e5IpTazecYrxWXhQ1mmpuikvbJgS6IanFUZc3C2Qp?= =?utf-8?q?RMYX0P4831IvhHlP4nS/rWRuMduFvw8hfKzHZQe92Cx7IVQ0Ipl1d69yIaW9zAw07?= =?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-Patchwork-Delegate: kuba@kernel.org 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,