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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250312123525.0164272e@fedora.home>
Date: Wed, 12 Mar 2025 12:35:25 +0100
From: Maxime Chevallier <maxime.chevallier@...tlin.com>
To: Michal Swiatkowski <michal.swiatkowski@...ux.intel.com>
Cc: netdev@...r.kernel.org, jiri@...nulli.us, davem@...emloft.net,
 edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com, horms@...nel.org,
 pierre@...ckhpc.com, hkallweit1@...il.com, linux@...linux.org.uk,
 christophe.leroy@...roup.eu, arkadiusz.kubalewski@...el.com,
 vadim.fedorenko@...ux.dev
Subject: Re: [PATCH net v2 3/3] phy: fix xa_alloc_cyclic() error handling

On Wed, 12 Mar 2025 10:52:51 +0100
Michal Swiatkowski <michal.swiatkowski@...ux.intel.com> wrote:

> xa_alloc_cyclic() can return 1, which isn't an error. To prevent
> situation when the caller of this function will treat it as no error do
> a check only for negative here.
> 
> Fixes: 384968786909 ("net: phy: Introduce ethernet link topology representation")
> Signed-off-by: Michal Swiatkowski <michal.swiatkowski@...ux.intel.com>
> ---
>  drivers/net/phy/phy_link_topology.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/phy/phy_link_topology.c b/drivers/net/phy/phy_link_topology.c
> index 4a5d73002a1a..0e9e987f37dd 100644
> --- a/drivers/net/phy/phy_link_topology.c
> +++ b/drivers/net/phy/phy_link_topology.c
> @@ -73,7 +73,7 @@ int phy_link_topo_add_phy(struct net_device *dev,
>  				      xa_limit_32b, &topo->next_phy_index,
>  				      GFP_KERNEL);
>  
> -	if (ret)
> +	if (ret < 0)
>  		goto err;
>  
>  	return 0;

Reviewed-by: Maxime Chevallier <maxime.chevallier@...tlin.com>

Thank you,

Maxime

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ