]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] VPU: mediatek: Fix return value in case of error
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 23 Sep 2016 21:19:01 +0000 (18:19 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Mon, 24 Oct 2016 20:11:57 +0000 (18:11 -0200)
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>
drivers/media/platform/mtk-vpu/mtk_vpu.c

index c3643d9291670894702c5967a4554513a82f92b8..463b69c934bef04db809db84d665382591e75e80 100644 (file)
@@ -689,7 +689,7 @@ static int vpu_alloc_ext_mem(struct mtk_vpu *vpu, u32 fw_type)
                                               GFP_KERNEL);
        if (!vpu->extmem[fw_type].va) {
                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 */