]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: usb: ax88179_178a: Add check for usbnet_get_endpoints()
authorMa Ke <make_ruc2021@163.com>
Wed, 24 Apr 2024 06:56:34 +0000 (14:56 +0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 26 Apr 2024 01:57:42 +0000 (18:57 -0700)
To avoid the failure of usbnet_get_endpoints(), we should check the
return value of the usbnet_get_endpoints().

Signed-off-by: Ma Ke <make_ruc2021@163.com>
Reviewed-by: Hariprasad Kelam <hkelam@marvell.com>
Link: https://lore.kernel.org/r/20240424065634.1870027-1-make_ruc2021@163.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/usb/ax88179_178a.c

index 377be0d9ef14ea33a2b4d8ef7d310642e4fbf506..b25535aa15ae33c84fa3fdfa46b6e4d3c4980e4c 100644 (file)
@@ -1286,8 +1286,11 @@ static void ax88179_get_mac_addr(struct usbnet *dev)
 static int ax88179_bind(struct usbnet *dev, struct usb_interface *intf)
 {
        struct ax88179_data *ax179_data;
+       int ret;
 
-       usbnet_get_endpoints(dev, intf);
+       ret = usbnet_get_endpoints(dev, intf);
+       if (ret < 0)
+               return ret;
 
        ax179_data = kzalloc(sizeof(*ax179_data), GFP_KERNEL);
        if (!ax179_data)