]> git.dujemihanovic.xyz Git - linux.git/commitdiff
asix: Add check for usbnet_get_endpoints
authorChen Ni <nichen@iscas.ac.cn>
Wed, 3 Jan 2024 03:35:34 +0000 (03:35 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 4 Jan 2024 10:50:57 +0000 (10:50 +0000)
Add check for usbnet_get_endpoints() and return the error if it fails
in order to transfer the error.

Fixes: 16626b0cc3d5 ("asix: Add a new driver for the AX88172A")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/ax88172a.c

index 3777c7e2e6fc00f30481f76d4c75ef058e553874..e47bb125048d47945af8883691e71fdfbf12e106 100644 (file)
@@ -161,7 +161,9 @@ static int ax88172a_bind(struct usbnet *dev, struct usb_interface *intf)
        u8 buf[ETH_ALEN];
        struct ax88172a_private *priv;
 
-       usbnet_get_endpoints(dev, intf);
+       ret = usbnet_get_endpoints(dev, intf);
+       if (ret)
+               return ret;
 
        priv = kzalloc(sizeof(*priv), GFP_KERNEL);
        if (!priv)