diff mbox series

[net,v2] net: ti: icssg-prueth: Fix error cleanup on failing pruss_request_mem_region

Message ID 06ed13ca-9f52-4b49-9178-aae245bfd958@siemens.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net,v2] net: ti: icssg-prueth: Fix error cleanup on failing pruss_request_mem_region | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 9 this patch: 9
netdev/cc_maintainers fail 3 blamed authors not CCed: rogerq@ti.com andrew@lunn.ch vigneshr@ti.com; 4 maintainers not CCed: robh@kernel.org rogerq@ti.com andrew@lunn.ch vigneshr@ti.com
netdev/build_clang success Errors and warnings before: 9 this patch: 9
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 9 this patch: 9
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 16 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

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

Wojciech Drewek Nov. 6, 2023, 10:07 a.m. UTC | #1
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 mbox series

Patch

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: