[PATCH 10/19] [media] uvc_driver: Return -ENOMEM after a failed kzalloc() call in uvc_parse_streaming()
From: SF Markus Elfring
Date: Sun Dec 25 2016 - 13:41:56 EST
From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
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@xxxxxxxxxxxxxxxxxxxxx>
---
drivers/media/usb/uvc/uvc_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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);
--
2.11.0