lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YjD2dFwpF+esPs33@lunn.ch>
Date:   Tue, 15 Mar 2022 21:26:28 +0100
From:   Andrew Lunn <andrew@...n.ch>
To:     cgel.zte@...il.comf
Cc:     kuba@...nel.org, sebastian.hesselbarth@...il.com,
        davem@...emloft.net, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, Minghao Chi <chi.minghao@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH] net: mv643xx_eth: undo some opreations in
 mv643xx_eth_probe

On Tue, Mar 15, 2022 at 02:30:19AM +0000, cgel.zte@...il.com wrote:
> From: Minghao Chi <chi.minghao@....com.cn>
> 
> Cannot directly return platform_get_irq return irq, there
> are operations that need to be undone.
> 
> Reported-by: Zeal Robot <zealci@....com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@....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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ