[net,v2] net: ti: icssg-prueth: Fix error cleanup on failing pruss_request_mem_region
Message ID | 06ed13ca-9f52-4b49-9178-aae245bfd958@siemens.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp2044917vqu; Sun, 5 Nov 2023 01:52:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IE4gnw9AVbsZsidAcJnG1mEuepDeD1sdM+Qci/EHl/Nx8KXVZGJKIkDIEw3dBMuFZL6CXNe X-Received: by 2002:a05:6870:1097:b0:1e9:f69a:1302 with SMTP id 23-20020a056870109700b001e9f69a1302mr26695919oaq.48.1699177925079; Sun, 05 Nov 2023 01:52:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699177925; cv=pass; d=google.com; s=arc-20160816; b=MfVqQsn3EJsSBHvXsG0bSjyAZj1QYWCLBGzC7GVixMtoCSaLkKXstTHxgBxJAz4P25 XJMRRtpj0d72i4dsJGCsqaMubGZ6vCfFDHu6LHthScA9c+14KYYHCAXSsusLSaKBvpy3 F321oKHPIGcUUgyekV/FsR9lP07pK4qDMEoKBg3mAf6DNiP9iinO011WaGbVL4WfYtdj +2cnCtN5U1hovR6/UJmSxt3XBE4emTTffeGx3LQpAWLSMYVN0MpxjvZSBCTSMpHgAhp+ 2BDBK7O5eLKMh75MquvcsW2obCZyTKkVKIe9NnGsjM9ZeNFvh7hb5ZHA05KU3GZWkQUk 1suQ== 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=drNeabeAd5ABgckLRSZ+8wug+1K0rKfYuSxCN55WjXg=; fh=IfDCyBAQ+OCqZE/5MjZ0TiIb+LM6ZvAzg9rjFsECMmU=; b=fEGWnWKuxKp8HEVfRLXyIExelx85GfctRYN5XBTRl56S401HXZElI4qMOG+4XAFZhk 8Tx/TNllBCemkiBByjKdkcCc0KdfeGribCVylWpQxWns/mJu1uFF06kGiMK89v1FKnjO HWr3hRIf7YiaWWxm5PdI5uJZTuY77iPYa8X6XDkvXaL8t6/5pW8qvx9/laKGPyC5fwFP IWJ1RYihylV8BKqN37ntWiZCo9sjCgDF9LseoPN3p2jbNA5qYDR2dNRuglYVpAEvCf0S 2Kh0fDfitTOyLK89ljj/NP7WAlNGiVj4JsmZ4XCfiph6Dhhqj3xqBqr+E83qj7yxOObS qgTQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=RKuGPjrp; 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.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id 66-20020a630845000000b005bce8cfb592si5573933pgi.245.2023.11.05.01.52.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 01:52:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=RKuGPjrp; 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.38 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 fry.vger.email (Postfix) with ESMTP id B2C02808BDBE; Sun, 5 Nov 2023 01:52:02 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229993AbjKEJvv (ORCPT <rfc822;lhua1029@gmail.com> + 35 others); Sun, 5 Nov 2023 04:51:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229644AbjKEJvs (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 5 Nov 2023 04:51:48 -0500 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2046.outbound.protection.outlook.com [40.107.6.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAD82FF; Sun, 5 Nov 2023 01:51:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ICCxVThpwh/jym/TLoa4wk742ORY02C1JQUl01CGHCIkfh3czO4VBZZo+SrahUgYqMjB+D86ibwQXWl4PlpCnV6uk/4nKL23dlV8BdqCdp458P8mKxT/uK087VpWyyM+lyb31ZOYQSLtMDyK6QW3KZQa6qPJ8POazBbGbs4kt3CSul+A6blDUIIfmcj/qxkvF0j/BBvu0y/o2g6/rbPQuTY9NU/Otj/dHh4tN7iJKdboGcf2rKE2H/G1cjtKH+6lqgfSMeOML1ReL6WF81UYpPcZyMe9Hw+K/ZBO1B8npV5Iq8W71FUAWVXKsos8FgNV0Y5vv9fikDVcfHvupUN2tA== 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=drNeabeAd5ABgckLRSZ+8wug+1K0rKfYuSxCN55WjXg=; b=UQMli4Sx9Jm6wizkWCtn5NEo4XE/dtG/H/YLJF0lUUNOKJ9v1w9/CDw8gFH1C+WaSyDGHxOMKxg/9miUyzWJQivPAktJ8VOtjwXiEgLRgQAM0BLuiWrmEA057Wv2JLhFBLAt5wem+fUe5PqKqL8E68MdANcieelWMI+lddFuKFFhCtftI+LjpYISV/IbEzveZUfYX7T2t0p0hdbub0azRfGBCnmDw+S5mWONpEoh1y94C1PMQ9qR/aDla1ULS0mFn9+DFIjqGgBGbVHqlC8UpoAYr2dQ2mACVhtron+w3aSFF5hyQgXlccOl7mH6mgisQoSSshQcBLbq/5e9FEBLXA== 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=drNeabeAd5ABgckLRSZ+8wug+1K0rKfYuSxCN55WjXg=; b=RKuGPjrpOjPAbeK9A/V3RHvPoABwswKsK01tHWFUp9U53pApHmaZf9q008eEqgy+pte/fcj0th8kvJVkrou38WJM9RKa5kirQ/T2pKZ4jyiSldizelMqGV815OVwTqJypYzwIaN9gzGVzTU5JL+luHbkMjVLvZuER56FV2nyI8ONNHssgIGZcJSXLnvkz4wPAgZbBk1+rBW8WGza/XAVTkcV63iOFeqH+hgaMfkql7e7oJbvAKgMKZHIZO9CeA84DWpuGYca6Rj9CAxsd/KIwf/Rw2bLEPgkJ4TIKnEFkKHGidtla5bNnvCmdIKzeryTNisrNri644c/ObQdagLDIw== 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 DB4PR10MB6309.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:383::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.25; Sun, 5 Nov 2023 09:51:43 +0000 Received: from AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM ([fe80::8496:a3a3:d7a8:b24d]) by AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM ([fe80::8496:a3a3:d7a8:b24d%4]) with mapi id 15.20.6954.027; Sun, 5 Nov 2023 09:51:43 +0000 Message-ID: <06ed13ca-9f52-4b49-9178-aae245bfd958@siemens.com> Date: Sun, 5 Nov 2023 10:51:42 +0100 User-Agent: Mozilla Thunderbird From: Jan Kiszka <jan.kiszka@siemens.com> Subject: [PATCH net v2] net: ti: icssg-prueth: Fix error cleanup on failing pruss_request_mem_region Content-Language: en-US To: "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, MD Danish Anwar <danishanwar@ti.com> Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Lopes Ivo, Diogo Miguel (T CED IFD-PT)" <diogo.ivo@siemens.com>, Nishanth Menon <nm@ti.com>, "Su, Bao Cheng (RC-CN DF FA R&D)" <baocheng.su@siemens.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR3P281CA0202.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a5::6) To AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:588::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS4PR10MB6181:EE_|DB4PR10MB6309:EE_ X-MS-Office365-Filtering-Correlation-Id: 7c7fcf9c-0d94-458a-460f-08dbdde4d0f0 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: oPCOrYrOCJ5vYClnMXbmDKxkTGnjM+HFzUG6svGPCK8GhavemrAZa8oOyGA8yC2jjW1sShU84Y57/bFWNXnNTZeyUnVOYDhOIRrdv1H92Jqex5mOLRDDWcJvd6G4uLxgFNQunyGXrFBYN5T6yVan1sIPOnGgR3wH18PQTNZVIa6QGU6TlG22u2fRzwAfJvMigUd18T3L6F/UDFXnAB6u5OTcx78pOqhPRPno88qJaET+kUFm9Z7fQK3gRW4rMLl9dr6n/tOSjcau8pk20pGISh1ZyoLALmWfZFgNU/JfkMt9uHCt3AivbbAf25XEVsOW2rNF5MoVbInQR38f6jDBFTqPjVmFEcA8/FNXxuiJGyBDLpAow+UDldL9hKxsLVRrt89NGaE2PtCvKuNunVYGPOKZk1f/Anbh8Dchl1cqgaIbkZHYkXaWrRShT3SNyrma3PaCzBpPKT8X7s1pEqUywB6hKpdO8wTXZrEz2LiWOXX7fmglK2dc4lcWxIoRy1WuGlX8SE5u9UabtsCp45SkBNUaaq26pudX6wxRop6ZMpi5k6+unf4CSoDF/GdUANxMz4GT+lKrxPqYRFDGbBg4+PwETRx1IxAYxr/6OZma/rDU6uOnf9JNcpq6LVNmd0uaW3WEIA8qW6NytOsS9kjmSQ== 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)(39860400002)(396003)(376002)(366004)(136003)(346002)(230922051799003)(451199024)(1800799009)(64100799003)(186009)(66476007)(31696002)(31686004)(86362001)(316002)(2906002)(41300700001)(5660300002)(44832011)(8676002)(8936002)(4326008)(36756003)(66556008)(38100700002)(82960400001)(54906003)(66946007)(110136005)(26005)(107886003)(6512007)(2616005)(478600001)(6486002)(83380400001)(6506007)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam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=?utf-8?q?SafXMB7KRx9pJm4JXVLvC2ghZFF/KZv6RyiNBKZo6yEwXbTAZAD8VOmOkZNG0xqon?= =?utf-8?q?0O4XKUE55V5n7JCmKhX+B/5Ip8GVOzL/vwpUjboylcN/bOrSUBR1LZWD1Ih/oqkGa?= =?utf-8?q?3VhItD6PEE8qBnEaAvEWdBPkFRd9U4jBEbGpvuwm6StVf8fE7hlYWstAX5W5c6sVE?= =?utf-8?q?Wf1scVbNe9YlObljlgCXpLpLaw2gr7B4fj4PIL3JuBL/Jf2Epc49n8EtxJLp2QDzo?= =?utf-8?q?sPhWY/k3Lmb5Zog+qn0oSTGKjC4l1QiLv6S0lX4NUFQRzgBPmHZpYZ6YHDLcGYuXW?= =?utf-8?q?/1xx+5WW7Q6IauZLudlx3GZ8gdze9por5WIjXZBlePlY7uya83qz8XiAPTjn9jzBc?= =?utf-8?q?77IS/iGHDPtAvzSRFPAosd7D6Z0Ho0+2Ug1S16BXewIgBYo8fnsTYcDBKR1re33xi?= =?utf-8?q?QWxeMmZi0Td3AHnkvGnt61Rr0D4Kwo+be6f0M6NnUF3AKT76ZoqEE+7PfD9NPQhm8?= =?utf-8?q?qKxNjxnZAQxXSVwG+znpn0N9A1+NreNaPjS8qv4JnFHwCQn+AnQmSpm/6ATm32SuN?= =?utf-8?q?Z2Z7jDd/fLRsHCiJH8udAaCBWsXg+rW4fKIVvCWaJJOHCuHBx9seQ5T0mIytXaRjs?= =?utf-8?q?yfvfUMKiy4Hzt+2oymTvbgyclRYAoyoulLP4rJT1BB19yPZkOt6og2jt0/dd0KiIn?= =?utf-8?q?uRGa7J1yBRzE?= X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7c7fcf9c-0d94-458a-460f-08dbdde4d0f0 X-MS-Exchange-CrossTenant-AuthSource: AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Nov 2023 09:51:43.1869 (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: zB5cPa2hk/+RH3bCEd3HslDIFKmL/NTJg0UPZrZRTaqiSqhGaf8PjIRRqBMOIOaRNhJiv+J3BofeaIIoOVdPsw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR10MB6309 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email 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 (fry.vger.email [0.0.0.0]); Sun, 05 Nov 2023 01:52:02 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781717191596639777 X-GMAIL-MSGID: 1781717191596639777 |
Series |
[net,v2] net: ti: icssg-prueth: Fix error cleanup on failing pruss_request_mem_region
|
|
Commit Message
Jan Kiszka
Nov. 5, 2023, 9:51 a.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com> 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 <jan.kiszka@siemens.com> --- Changes in v2: - add proper tags drivers/net/ethernet/ti/icssg/icssg_prueth.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Comments
On 05.11.2023 10:51, Jan Kiszka wrote: > From: Jan Kiszka <jan.kiszka@siemens.com> > > 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 <jan.kiszka@siemens.com> > --- Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com> > > 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 d119b2bb8158..845e8a782d3a 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:
diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth.c b/drivers/net/ethernet/ti/icssg/icssg_prueth.c index d119b2bb8158..845e8a782d3a 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: