Message ID | 20240424065634.1870027-1-make_ruc2021@163.com |
---|---|
State | New |
Headers | show |
Series | [v2] net: usb: ax88179_178a: Add check for usbnet_get_endpoints() | expand |
Hello: This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <kuba@kernel.org>: On Wed, 24 Apr 2024 14:56:34 +0800 you wrote: > 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> > --- > drivers/net/usb/ax88179_178a.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) Here is the summary with links: - [v2] net: usb: ax88179_178a: Add check for usbnet_get_endpoints() https://git.kernel.org/netdev/net-next/c/3837639ebfdd You are awesome, thank you!
diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c index 752f821a1990..388ea178c91d 100644 --- a/drivers/net/usb/ax88179_178a.c +++ b/drivers/net/usb/ax88179_178a.c @@ -1287,8 +1287,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)
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> --- drivers/net/usb/ax88179_178a.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)