Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

[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
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -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,
		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;
		}
		}