瀏覽代碼

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>
Christophe JAILLET 9 年之前
父節點
當前提交
bd610c5aa9
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/usb/gadget/function/uvc_configfs.c

+ 1 - 1
drivers/usb/gadget/function/uvc_configfs.c

@@ -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;