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: <57262956.3060206@gmail.com>
Date:	Sun, 1 May 2016 09:05:42 -0700
From:	Florian Fainelli <f.fainelli@...il.com>
To:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>,
	netdev@...r.kernel.org
Cc:	arnd@...db.de
Subject: Re: [PATCH] pxa168_eth: fix mdiobus_scan() error check

Le 30/04/2016 13:35, Sergei Shtylyov a écrit :
> Since mdiobus_scan() returns either an error code or NULL on error, the
> driver should check  for both,  not only for NULL, otherwise a crash is
> imminent...
> 
> Reported-by: Arnd Bergmann <arnd@...db.de>
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
> 
> ---
> The patch is against DaveM's 'net.git' repo.
> 
>  drivers/net/ethernet/marvell/pxa168_eth.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> Index: net/drivers/net/ethernet/marvell/pxa168_eth.c
> ===================================================================
> --- net.orig/drivers/net/ethernet/marvell/pxa168_eth.c
> +++ net/drivers/net/ethernet/marvell/pxa168_eth.c
> @@ -979,6 +979,8 @@ static int pxa168_init_phy(struct net_de
>  		return 0;
>  
>  	pep->phy = mdiobus_scan(pep->smi_bus, pep->phy_addr);
> +	if (IS_ERR(pep->phy))
> +		return PTR_ERR(pep->phy);
>  	if (!pep->phy)
>  		return -ENODEV;

Should not this check be removed too and converted to a
PTR_ERR(pep->phy) != -ENODEV?
-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ