From: Christophe JAILLET Date: Fri, 23 Sep 2016 21:19:01 +0000 (-0300) Subject: [media] VPU: mediatek: Fix return value in case of error X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8a5d2acee6fa9ec5997335cc3ebdd47c7524d6d2;p=linux-beck.git [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 Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/mtk-vpu/mtk_vpu.c b/drivers/media/platform/mtk-vpu/mtk_vpu.c index c3643d929167..463b69c934be 100644 --- a/drivers/media/platform/mtk-vpu/mtk_vpu.c +++ b/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); 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 */