diff options
author | Ma Ke <make_ruc2021@163.com> | 2024-04-24 14:56:34 +0800 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-04-25 18:57:42 -0700 |
commit | 3837639ebfdd9fbb9aa2acfcc1612043d35340fe (patch) | |
tree | 01ee27fb2fda65a91d668655a5be7cf543668f0e /drivers/net/usb | |
parent | 0805d67bc0ef95411228e802f31975cfb7555056 (diff) | |
download | linux-3837639ebfdd9fbb9aa2acfcc1612043d35340fe.tar.gz linux-3837639ebfdd9fbb9aa2acfcc1612043d35340fe.tar.bz2 linux-3837639ebfdd9fbb9aa2acfcc1612043d35340fe.zip |
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 <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>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r-- | drivers/net/usb/ax88179_178a.c | 5 |
1 files changed, 4 insertions, 1 deletions
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) |