]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
phy: fix xa_alloc_cyclic() error handling
authorMichal Swiatkowski <michal.swiatkowski@linux.intel.com>
Wed, 12 Mar 2025 09:52:51 +0000 (10:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Mar 2025 21:03:27 +0000 (22:03 +0100)
commit58ed057dcdb38aa6c25397f8752f15edae226368
treefd5e368e675bb407914c0a3b36aa0d681b65924a
parentcb2f8a5c1fd9e7a1fefa23afe20570e16da1ada4
phy: fix xa_alloc_cyclic() error handling

[ Upstream commit 3178d2b048365fe2c078cd53f85f2abf1487733b ]

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@linux.intel.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/phy/phy_link_topology.c