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:

committed by
Felipe Balbi

parent
63196e9896
commit
bd610c5aa9
@@ -2023,7 +2023,7 @@ static int uvcg_streaming_class_allow_link(struct config_item *src,
|
|||||||
if (!data) {
|
if (!data) {
|
||||||
kfree(*class_array);
|
kfree(*class_array);
|
||||||
*class_array = NULL;
|
*class_array = NULL;
|
||||||
ret = PTR_ERR(data);
|
ret = -ENOMEM;
|
||||||
goto unlock;
|
goto unlock;
|
||||||
}
|
}
|
||||||
cl_arr = *class_array;
|
cl_arr = *class_array;
|
||||||
|
Reference in New Issue
Block a user