浏览代码

[media] VPU: mediatek: Fix return value in case of error

If 'dma_alloc_coherent()' returns NULL, 'vpu_alloc_ext_mem()' will
return 0 which means success.
Return -ENOMEM instead.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Christophe JAILLET 9 年之前
父节点
当前提交
8a5d2acee6
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/media/platform/mtk-vpu/mtk_vpu.c

+ 1 - 1
drivers/media/platform/mtk-vpu/mtk_vpu.c

@@ -689,7 +689,7 @@ static int vpu_alloc_ext_mem(struct mtk_vpu *vpu, u32 fw_type)
 					       GFP_KERNEL);
 					       GFP_KERNEL);
 	if (!vpu->extmem[fw_type].va) {
 	if (!vpu->extmem[fw_type].va) {
 		dev_err(dev, "Failed to allocate the extended program memory\n");
 		dev_err(dev, "Failed to allocate the extended program memory\n");
-		return PTR_ERR(vpu->extmem[fw_type].va);
+		return -ENOMEM;
 	}
 	}
 
 
 	/* Disable extend0. Enable extend1 */
 	/* Disable extend0. Enable extend1 */