mirror of
https://github.com/Dasharo/linux.git
synced 2026-03-06 15:25:10 -08:00
phy: fix xa_alloc_cyclic() error handling
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: 3849687869 ("net: phy: Introduce ethernet link topology representation")
Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
3614bf9013
commit
3178d2b048
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user