Commit 72ef8ab4 authored by Duncan Sands's avatar Duncan Sands Committed by Greg Kroah-Hartman

[PATCH] USBATM: return correct error code when out of memory

We weren't always returning -ENOMEM.
Signed-off-by: default avatarDuncan Sands <baldrick@free.fr>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 0e42a627
...@@ -1081,6 +1081,7 @@ int usbatm_usb_probe(struct usb_interface *intf, const struct usb_device_id *id, ...@@ -1081,6 +1081,7 @@ int usbatm_usb_probe(struct usb_interface *intf, const struct usb_device_id *id,
urb = usb_alloc_urb(iso_packets, GFP_KERNEL); urb = usb_alloc_urb(iso_packets, GFP_KERNEL);
if (!urb) { if (!urb) {
dev_err(dev, "%s: no memory for urb %d!\n", __func__, i); dev_err(dev, "%s: no memory for urb %d!\n", __func__, i);
error = -ENOMEM;
goto fail_unbind; goto fail_unbind;
} }
...@@ -1090,6 +1091,7 @@ int usbatm_usb_probe(struct usb_interface *intf, const struct usb_device_id *id, ...@@ -1090,6 +1091,7 @@ int usbatm_usb_probe(struct usb_interface *intf, const struct usb_device_id *id,
buffer = kzalloc(channel->buf_size, GFP_KERNEL); buffer = kzalloc(channel->buf_size, GFP_KERNEL);
if (!buffer) { if (!buffer) {
dev_err(dev, "%s: no memory for buffer %d!\n", __func__, i); dev_err(dev, "%s: no memory for buffer %d!\n", __func__, i);
error = -ENOMEM;
goto fail_unbind; goto fail_unbind;
} }
......
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