linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: mv643xx_eth: undo some opreations in mv643xx_eth_probe
@ 2022-03-15  2:30 cgel.zte
  2022-03-15 20:26 ` Andrew Lunn
  0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2022-03-15  2:30 UTC (permalink / raw)
  To: kuba
  Cc: sebastian.hesselbarth, davem, netdev, linux-kernel, Minghao Chi,
	Zeal Robot

From: Minghao Chi <chi.minghao@zte.com.cn>

Cannot directly return platform_get_irq return irq, there
are operations that need to be undone.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
---
 drivers/net/ethernet/marvell/mv643xx_eth.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index e6cd4e214d79..6cd81737786e 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -3189,8 +3189,11 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
 
 
 	irq = platform_get_irq(pdev, 0);
-	if (WARN_ON(irq < 0))
+	if (WARN_ON(irq < 0)) {
+		clk_disable_unprepare(mp->clk);
+		free_netdev(dev);
 		return irq;
+	}
 	dev->irq = irq;
 
 	dev->netdev_ops = &mv643xx_eth_netdev_ops;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: mv643xx_eth: undo some opreations in mv643xx_eth_probe
  2022-03-15  2:30 [PATCH] net: mv643xx_eth: undo some opreations in mv643xx_eth_probe cgel.zte
@ 2022-03-15 20:26 ` Andrew Lunn
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Lunn @ 2022-03-15 20:26 UTC (permalink / raw)
  To: cgel.zte
  Cc: kuba, sebastian.hesselbarth, davem, netdev, linux-kernel,
	Minghao Chi, Zeal Robot

On Tue, Mar 15, 2022 at 02:30:19AM +0000, cgel.zte@gmail.com wrote:
> From: Minghao Chi <chi.minghao@zte.com.cn>
> 
> Cannot directly return platform_get_irq return irq, there
> are operations that need to be undone.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
> ---
>  drivers/net/ethernet/marvell/mv643xx_eth.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
> index e6cd4e214d79..6cd81737786e 100644
> --- a/drivers/net/ethernet/marvell/mv643xx_eth.c
> +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
> @@ -3189,8 +3189,11 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
>  
>  
>  	irq = platform_get_irq(pdev, 0);
> -	if (WARN_ON(irq < 0))
> +	if (WARN_ON(irq < 0)) {
> +		clk_disable_unprepare(mp->clk);
> +		free_netdev(dev);
>  		return irq;
> +	}

Isn't this where i said you should:

	goto out;

You need to set err first.

	Andrew

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-15 20:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-15  2:30 [PATCH] net: mv643xx_eth: undo some opreations in mv643xx_eth_probe cgel.zte
2022-03-15 20:26 ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).