diff mbox

[10/19,media] uvc_driver: Return -ENOMEM after a failed kzalloc() call in uvc_parse_streaming()

Message ID cca09ee1-dc30-b3e6-41fb-63c1443bf91b@users.sourceforge.net (mailing list archive)
State New, archived
Headers show

Commit Message

SF Markus Elfring Dec. 25, 2016, 6:41 p.m. UTC
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 25 Dec 2016 16:00:17 +0100

Use the return code "-ENOMEM" (instead of "-EINVAL") after a call of
the function "kzalloc" failed here.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/media/usb/uvc/uvc_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index b0833902fde2..5736f8b26f92 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -663,7 +663,7 @@  static int uvc_parse_streaming(struct uvc_device *dev,
 	streaming = kzalloc(sizeof(*streaming), GFP_KERNEL);
 	if (!streaming) {
 		usb_driver_release_interface(&uvc_driver.driver, intf);
-		return -EINVAL;
+		return -ENOMEM;
 	}
 
 	mutex_init(&streaming->mutex);