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

From: Duncan Sands
Date: Fri Jan 13 2006 - 04:06:08 EST


We weren't always returning -ENOMEM.

Signed-off-by: Duncan Sands <baldrick@xxxxxxx>
Index: Linux/drivers/usb/atm/usbatm.c
===================================================================
--- Linux.orig/drivers/usb/atm/usbatm.c 2006-01-13 08:57:48.000000000 +0100
+++ Linux/drivers/usb/atm/usbatm.c 2006-01-13 08:59:16.000000000 +0100
@@ -1081,6 +1081,7 @@
urb = usb_alloc_urb(iso_packets, GFP_KERNEL);
if (!urb) {
dev_err(dev, "%s: no memory for urb %d!\n", __func__, i);
+ error = -ENOMEM;
goto fail_unbind;
}

@@ -1090,6 +1091,7 @@
buffer = kzalloc(channel->buf_size, GFP_KERNEL);
if (!buffer) {
dev_err(dev, "%s: no memory for buffer %d!\n", __func__, i);
+ error = -ENOMEM;
goto fail_unbind;
}