net: mdio: mvusb: Fix an error handling path in mvusb_mdio_probe()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 5 May 2023 18:39:33 +0000 (20:39 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 May 2023 16:32:31 +0000 (17:32 +0100)
commit27c6b573d1501a457f1e797aa659e820b1c67797
tree375c7a94268a11db5692d8d8b1a32ea0ebcd2ffb
parent3e785c8deb046305c61b9fa02265d0cb900c4a45
net: mdio: mvusb: Fix an error handling path in mvusb_mdio_probe()

[ Upstream commit 27c1eaa07283b0c94becf8241f95368267cf558b ]

Should of_mdiobus_register() fail, a previous usb_get_dev() call should be
undone as in the .disconnect function.

Fixes: 04e37d92fbed ("net: phy: add marvell usb to mdio controller")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/mdio/mdio-mvusb.c