All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: cgel.zte@gmail.comf
Cc: kuba@kernel.org, sebastian.hesselbarth@gmail.com,
	davem@davemloft.net, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Minghao Chi <chi.minghao@zte.com.cn>,
	Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH] net: mv643xx_eth: undo some opreations in mv643xx_eth_probe
Date: Tue, 15 Mar 2022 21:26:28 +0100	[thread overview]
Message-ID: <YjD2dFwpF+esPs33@lunn.ch> (raw)
In-Reply-To: <20220315023019.2118163-1-chi.minghao@zte.com.cn>

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

      reply	other threads:[~2022-03-15 20:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YjD2dFwpF+esPs33@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=cgel.zte@gmail.comf \
    --cc=chi.minghao@zte.com.cn \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sebastian.hesselbarth@gmail.com \
    --cc=zealci@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.