Commit 09b69024 authored by Wei Yongjun's avatar Wei Yongjun Committed by David S. Miller

usbnet: fix error return code in usbnet_probe()

Fix to return -ENOMEM in the padding pkt alloc fail error handling
case instead of 0, as done elsewhere in this function.
Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: default avatarOliver Neukum <oneukum@suse.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 72590782
...@@ -1688,9 +1688,11 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) ...@@ -1688,9 +1688,11 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
if (dev->can_dma_sg && !(info->flags & FLAG_SEND_ZLP) && if (dev->can_dma_sg && !(info->flags & FLAG_SEND_ZLP) &&
!(info->flags & FLAG_MULTI_PACKET)) { !(info->flags & FLAG_MULTI_PACKET)) {
dev->padding_pkt = kzalloc(1, GFP_KERNEL); dev->padding_pkt = kzalloc(1, GFP_KERNEL);
if (!dev->padding_pkt) if (!dev->padding_pkt) {
status = -ENOMEM;
goto out4; goto out4;
} }
}
status = register_netdev (net); status = register_netdev (net);
if (status) if (status)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment