Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Christophe JAILLET and committed by
Mauro Carvalho Chehab
8a5d2ace c771f42f

+1 -1
+1 -1
drivers/media/platform/mtk-vpu/mtk_vpu.c
··· 689 689 GFP_KERNEL); 690 690 if (!vpu->extmem[fw_type].va) { 691 691 dev_err(dev, "Failed to allocate the extended program memory\n"); 692 - return PTR_ERR(vpu->extmem[fw_type].va); 692 + return -ENOMEM; 693 693 } 694 694 695 695 /* Disable extend0. Enable extend1 */