From: Ma Ke Date: Wed, 24 Apr 2024 06:56:34 +0000 (+0800) Subject: net: usb: ax88179_178a: Add check for usbnet_get_endpoints() X-Git-Tag: microblaze-v6.13~1163^2~155 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=3837639ebfdd9fbb9aa2acfcc1612043d35340fe;p=linux-2.6-microblaze.git net: usb: ax88179_178a: Add check for usbnet_get_endpoints() To avoid the failure of usbnet_get_endpoints(), we should check the return value of the usbnet_get_endpoints(). Signed-off-by: Ma Ke Reviewed-by: Hariprasad Kelam Link: https://lore.kernel.org/r/20240424065634.1870027-1-make_ruc2021@163.com Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c index 377be0d9ef14..b25535aa15ae 100644 --- a/drivers/net/usb/ax88179_178a.c +++ b/drivers/net/usb/ax88179_178a.c @@ -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)