]> www.infradead.org Git - users/hch/misc.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)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Mar 2025 09:57:37 +0000 (09:57 +0000)
commit3178d2b048365fe2c078cd53f85f2abf1487733b
tree730c91319266d5994452fcbf31590f3661acf348
parent3614bf90130d60f191a5fe218d04f6251c678e13
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: 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>
drivers/net/phy/phy_link_topology.c