usb: gadget: uvc: Fix return value in case of error

If this memory allocation fail, we will return 0, which means success.
Return -ENOMEM instead.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
This commit is contained in:
Christophe JAILLET 2016-07-16 09:04:40 +02:00 committed by Felipe Balbi
parent 63196e9896
commit bd610c5aa9
1 changed files with 1 additions and 1 deletions

View File

@ -2023,7 +2023,7 @@ static int uvcg_streaming_class_allow_link(struct config_item *src,
if (!data) {
kfree(*class_array);
*class_array = NULL;
ret = PTR_ERR(data);
ret = -ENOMEM;
goto unlock;
}
cl_arr = *class_array;