summaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/ax88172a.c
diff options
context:
space:
mode:
authorOleksij Rempel <o.rempel@pengutronix.de>2021-06-07 10:27:21 +0200
committerDavid S. Miller <davem@davemloft.net>2021-06-07 13:23:02 -0700
commit7e88b11a862afe59ee0c365123ea5fb96a26cb3b (patch)
treeecf6cdec29146efc42de175162ec008b19305a9b /drivers/net/usb/ax88172a.c
parent218d154f540a58b82394e128e425560181c1662e (diff)
downloadlinux-7e88b11a862afe59ee0c365123ea5fb96a26cb3b.tar.bz2
net: usb: asix: refactor asix_read_phy_addr() and handle errors on return
Refactor asix_read_phy_addr() to return usable error value directly and make sure all callers handle this error. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb/ax88172a.c')
-rw-r--r--drivers/net/usb/ax88172a.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/usb/ax88172a.c b/drivers/net/usb/ax88172a.c
index b404c9462dce..c8ca5187eece 100644
--- a/drivers/net/usb/ax88172a.c
+++ b/drivers/net/usb/ax88172a.c
@@ -220,6 +220,11 @@ static int ax88172a_bind(struct usbnet *dev, struct usb_interface *intf)
}
priv->phy_addr = asix_read_phy_addr(dev, priv->use_embdphy);
+ if (priv->phy_addr < 0) {
+ ret = priv->phy_addr;
+ goto free;
+ }
+
ax88172a_reset_phy(dev, priv->use_embdphy);
/* Asix framing packs multiple eth frames into a 2K usb bulk transfer */