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] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 10 Oct 2018 08:49:02 +0200
From:   Quentin Schulz <quentin.schulz@...tlin.com>
To:     "Gustavo A. R. Silva" <gustavo@...eddedor.com>
Cc:     linux-kernel@...r.kernel.org, Andrew Lunn <andrew@...n.ch>,
        Florian Fainelli <f.fainelli@...il.com>,
        "David S. Miller" <davem@...emloft.net>
Subject: Re: [PATCH net-next 2/2] net: phy: mscc: fix memory leak in
 vsc8574_config_pre_init

Hi Gustavo,

On Tue, Oct 09, 2018 at 09:39:53PM +0200, Gustavo A. R. Silva wrote:
> In case memory resources for *fw* were successfully allocated,
> release them before return.
> 
> Addresses-Coverity-ID: 1473968 ("Resource leak")
> Fixes: 00d70d8e0e78 ("net: phy: mscc: add support for VSC8574 PHY")
> Signed-off-by: Gustavo A. R. Silva <gustavo@...eddedor.com>
> ---
>  drivers/net/phy/mscc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/phy/mscc.c b/drivers/net/phy/mscc.c
> index bff56c3..af9fb2d 100644
> --- a/drivers/net/phy/mscc.c
> +++ b/drivers/net/phy/mscc.c
> @@ -1292,7 +1292,7 @@ static int vsc8574_config_pre_init(struct phy_device *phydev)
>  				dev_err(dev,
>  					"%s: failed to assert reset of micro\n",
>  					__func__);
> -				return ret;
> +				goto release_fw;
>  			}
>  		}
>  	} else {
> @@ -1338,7 +1338,7 @@ static int vsc8574_config_pre_init(struct phy_device *phydev)
>  
>  out:
>  	phy_base_write(phydev, MSCC_EXT_PAGE_ACCESS, MSCC_PHY_PAGE_STANDARD);
> -
> +release_fw:
>  	release_firmware(fw);

You can reuse the out goto label instead, I would like all functions in
the driver to exit with the PHY set to access the standard page.

Thanks,
Quentin

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ