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]
Message-ID: <ad34c73f-19ee-eb83-221b-cd9fac1d44d5@marvell.com>
Date:   Mon, 28 Oct 2019 10:53:54 +0000
From:   Igor Russkikh <irusskikh@...vell.com>
To:     "Gustavo A. R. Silva" <gustavo@...eddedor.com>,
        Igor Russkikh <Igor.Russkikh@...antia.com>,
        "David S. Miller" <davem@...emloft.net>,
        "Dmitry Bezrukov" <Dmitry.Bezrukov@...antia.com>,
        Nikita Danilov <Nikita.Danilov@...antia.com>,
        Andrew Lunn <andrew@...n.ch>
CC:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [EXT] [PATCH net-next] net: aquantia: fix error handling in
 aq_nic_init


> Fix currenty ignored returned error by properly error checking
> aq_phy_init().
> 
> Addresses-Coverity-ID: 1487376 ("Unused value")
> Fixes: dbcd6806af42 ("net: aquantia: add support for Phy access")
> Signed-off-by: Gustavo A. R. Silva <gustavo@...eddedor.com>
> ---
>  drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
> index 433adc099e44..1914aa0a19d0 100644
> --- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
> +++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
> @@ -341,7 +341,8 @@ int aq_nic_init(struct aq_nic_s *self)
>  
>  	if (self->aq_nic_cfg.aq_hw_caps->media_type == AQ_HW_MEDIA_TYPE_TP) {
>  		self->aq_hw->phy_id = HW_ATL_PHY_ID_MAX;
> -		err = aq_phy_init(self->aq_hw);
> +		if (!aq_phy_init(self->aq_hw))
> +			goto err_exit;
>  	}
>  
>  	for (i = 0U, aq_vec = self->aq_vec[0];
> 

Hi Gustavo,

I'd say the intention here was to ignore the error, as driver may still live if
something unexpected happened on Phy access path.

Notice in the above fix you leave `err` as zero but do error path return -
that'll break the datapath.

I'd prefer to fix this with simple

     (void)aq_phy_init(self->aq_hw);

-- 
Regards,
  Igor

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ