]> git.itanic.dy.fi Git - linux-stable/commit
net: phy: propagate an error back to the callers of phy_sfp_probe
authorLeon Romanovsky <leonro@mellanox.com>
Sun, 17 May 2020 11:53:40 +0000 (14:53 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 7 Jun 2020 11:16:46 +0000 (13:16 +0200)
commitcf8ca068f20128dddf0e81d1ecb05fcd960ed59d
treebb7bbf817d1a15ec304be491514416a58bfc29a2
parenta04fbca67f33e7d76dcb4779e54b8184f7329c9d
net: phy: propagate an error back to the callers of phy_sfp_probe

[ Upstream commit e3f2d5579c0b8ad9d1fb6a5813cee38a86386e05 ]

The compilation warning below reveals that the errors returned from
the sfp_bus_add_upstream() call are not propagated to the callers.
Fix it by returning "ret".

14:37:51 drivers/net/phy/phy_device.c: In function 'phy_sfp_probe':
14:37:51 drivers/net/phy/phy_device.c:1236:6: warning: variable 'ret'
   set but not used [-Wunused-but-set-variable]
14:37:51  1236 |  int ret;
14:37:51       |      ^~~

Fixes: 298e54fa810e ("net: phy: add core phylib sfp support")
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/phy/phy_device.c