From patchwork Fri Nov 10 16:13:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 13452516 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 879EB1DDD1 for ; Fri, 10 Nov 2023 16:13:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=siemens.com header.i=@siemens.com header.b="FDsqhMtH" Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2060.outbound.protection.outlook.com [40.107.22.60]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BE8F3C6DC; Fri, 10 Nov 2023 08:13:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KlF5B1VwxJk65FKPPcw42ItGABlGeosmT2zMRdHTp53WQkx3819LnuKhlknga//uG7a9pgSU15sBdxwM1Q2TKoASdTp3/KveSNR0fHRvaUx9j43lXOgMICJUpXQm0M1lG6IRZPa5JpJCPltWNH16iC94DG7loLkxsfru23MU6Gn6pYAfnpWBhycGfS+Ymm7uRfQTB0b02UKk83spprPmdlS0FhCrYfGvQavsyMwPBkO01qVOK8kSVhILJISgzkeYPBcDtbTbQw/i+rRGHuHJArNvuLnQSiMlT8Ozp7a55jDjSdDFZmUwCCGG7kWHTXspe/zDE2nUB49mAyAx8b8MNQ== 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=hilBLmloGI2KW5v4LTvPpRXcsATvidr46sHBmznin9g=; b=nXSHWG6yi8OcCi8/5TLyg0M3tJTHH6Pt7aV9iZeTudoxkZAdprNxzCoTTcsvehHjHFjoPApdf0yejMVT9gadlvmiIXfnOfgPQnfljiY00P5szGKOegUtKhX02haQg45L2FtZlYDbt2rCkEFa+5LlhrURox9iWparMQ+Vdbr7pn0WYpTyDooFSZYRTladYAnoQETU+fngjU+zMIIMwY505MwedRmvuCuXeN/AwRyMyQryPT5IKrmY3NNbgTtz9sMyNA5zG6z063fS5qthDZhaS8L5CxkjRPDFvFUXTXP+bDB+JJWIZmDZvyGNzgJJtd7e/y6H6uJJRnObqxTv9E3eFA== 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=hilBLmloGI2KW5v4LTvPpRXcsATvidr46sHBmznin9g=; b=FDsqhMtHDgkGONFUmJid8NGtWNCeKfsGCUidELSXloN5ownIrHOipjc3I1vO44kHep4sVs8t+vM1r+8WaH76Ng/qrHqj0UcguTIfJVDnM/RQ3mjYgMyYGUo23M+/09zQ0/A8YAXJF1SAoOJPWuTPnu/UvvqKhOJFoEnmr/CRhXN+CbuxQ+vXe3Z9mfl4t6deFPNLE1U75Y0JnV4UmjFHaZw9GENtxQsWDQWYZuS6NJqgPovixlsTQ6aoz1YlKMo7c3lG3GPxirCY1oRFii/oe1q11soBq8QGpdLT3GOHdwHS0Y9gNhWOd/81b1T6XPaARSKaDrug00j2diqeNukqrg== 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:15 +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:15 +0000 Message-ID: Date: Fri, 10 Nov 2023 17:13:08 +0100 User-Agent: Mozilla Thunderbird From: Jan Kiszka Subject: [PATCH net v3] net: ti: icssg-prueth: Fix error cleanup on failing pruss_request_mem_region 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: CH0PR04CA0026.namprd04.prod.outlook.com (2603:10b6:610:76::31) 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: 3086af3e-d324-470a-e115-08dbe207f1ab 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: um/ZetfxVeF82x7pULHS2LM2OXTODsdfUKpKZ2eDWfR2tQJt9hP5puG4TxSVHtoyLtexcn1Lex4wc78az4MmzSVtW/TJlvY+zP/oOzpvqKOZNZjb84c8XMS1VXGf9/cn5Vc7ArJYt5Ul6a129DuLuME9NbBd5A/o0+nW5xJz6zGWDoz/of0B5FF+tKAHbyObbJpg4jx18tl6e3qFbrzJT/0UeHyMRXxbiCLN8xMUG8QFFkGoC2bvNNE25aGYlk5qZTEYCJF/WchoRozeEjGRWa0duPFbSATXJZWvXBgZMfxdY+cWUqXOsvr2rwh3zptmBrfrMYyT+4cGonhHxTCbuK3Zg3IOSdreDEbPZkMPS10gY6IiTDODPDWdJt/IDVBVRGb8SNauYyLFOIChoipjBTV09utHqrKpJNhvPr1W7GpgZYxFDQRcD4jaeUQFwrawa94iXyPyvERWcr9/Jr1LSTlgKZbCGRePukE5nrm9nEjllGmHmAOL4u2xN+c0Yq4UIorGKhlgmWhYPEHO7doKUyz9G2ZcwkJqYxkR3yPvF971McP79MT596/ufcUmRjYBCKK369rpEj/LnTAa+fyge1mBLx6HP0CHNYwgPvlUwY1eV00mzekISOv1fUaanWk7paIKgxVIH19lXauLndae4A== 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?yW224IlGoMLad9HXd41EoucMEbrr?= =?utf-8?q?r7Eyj/sodZlPsbi2BCq3XOBg2MhteWkez5FHI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Ik2T0bFQBO2Gnc1?= =?utf-8?q?SKjheO3/EPjSNHPKPJJz4ri2jS7UhhxdjRH+SQxupkNnNsFI1Unqd7ssS1ulAc2Pj?= =?utf-8?q?qrFxhF5egL2ratwIn2T2i+r58fThGi/RXTFlUxf98Ook40gI4GG5a8hFtkVvfjbuh?= =?utf-8?q?edLzoXPrG1/hBcPgmbr0WGJfHx58AANfVWTK1rZFQyEtKcx0tKrN0k31gR3dqVuWs?= =?utf-8?q?bPWWjzy3u8n8fAaGXLyEOqDuPvzkUYVseNL6Y74VEB5VdSncQrsVpCaioz7c3+jhO?= =?utf-8?q?dU/KPY2s5uj4d6iGcegGx7V0d3zVhbAmprYbSNFYse9FlUjVhsEvnGyEbMxAG5n/o?= =?utf-8?q?N9m3YnEMsUVVEkUBljFYHQ9iycGdI6DEj66sBQNIn2fg3zSmldq/gvPTNCT30QrF1?= =?utf-8?q?baHJpOyz1DTiLZK42/CImE0DORDDuAvjO1dvHX1ve4tIFaz5IHnMKhB32Wj/du/aO?= =?utf-8?q?wUzlJZGrd5J73LpcSwE/mBopWN3xOHuEt1vl7a73eps9lnwJ9pGMbO1Lhzcw2X6OP?= =?utf-8?q?pPiU7oeTg0lkICcacEqgOcQ1a3kDyS2Pys9zRgCXUpgBl+pzH+Tw+wWlPvn8KGcIM?= =?utf-8?q?ff7PMy7fq7wDJ/PcmWJFeXWD69IDJC0KQQ=3D=3D?= X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3086af3e-d324-470a-e115-08dbe207f1ab 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:15.2140 (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: V8SpgSr3WDjhGQjGK4y3hvv6z+G7rFrZGU2qBtAnLE/ngx2byRhQeqxFDdESBb8QiA6WG2No1O2Zpw4ggnG1hA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR10MB7970 X-Patchwork-Delegate: kuba@kernel.org From: Jan Kiszka We were just continuing in this case, surely not desired. Fixes: 128d5874c082 ("net: ti: icssg-prueth: Add ICSSG ethernet driver") Signed-off-by: Jan Kiszka Reviewed-by: Wojciech Drewek Reviewed-by: Roger Quadros --- Changes in v3: - no functional ones - added original author in CC with new address Changes in v2: - add proper tags drivers/net/ethernet/ti/icssg/icssg_prueth.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth.c b/drivers/net/ethernet/ti/icssg/icssg_prueth.c index 3abbeba26f1b..411898a4f38c 100644 --- a/drivers/net/ethernet/ti/icssg/icssg_prueth.c +++ b/drivers/net/ethernet/ti/icssg/icssg_prueth.c @@ -2063,7 +2063,7 @@ static int prueth_probe(struct platform_device *pdev) &prueth->shram); if (ret) { dev_err(dev, "unable to get PRUSS SHRD RAM2: %d\n", ret); - pruss_put(prueth->pruss); + goto put_pruss; } prueth->sram_pool = of_gen_pool_get(np, "sram", 0); @@ -2215,6 +2215,8 @@ static int prueth_probe(struct platform_device *pdev) put_mem: pruss_release_mem_region(prueth->pruss, &prueth->shram); + +put_pruss: pruss_put(prueth->pruss); put_cores: