mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-05 01:54:09 +08:00
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:
parent
63196e9896
commit
bd610c5aa9
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user