From: Mikko Perttunen Date: Thu, 13 Apr 2023 08:22:01 +0000 (+0300) Subject: drm/tegra: Add error check for NVDEC firmware memory allocation X-Git-Tag: v6.6.17~3937^2~18^2~105 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cf8d3223218744d29793071ec6d61eba29057d90;p=platform%2Fkernel%2Flinux-rpi.git drm/tegra: Add error check for NVDEC firmware memory allocation The return value for tegra_drm_alloc was missing an error check. Add one. Reported-by: Dan Carpenter Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20230413082202.114721-1-cyndis@kapsi.fi --- diff --git a/drivers/gpu/drm/tegra/nvdec.c b/drivers/gpu/drm/tegra/nvdec.c index f821e36111a7..9f57968392af 100644 --- a/drivers/gpu/drm/tegra/nvdec.c +++ b/drivers/gpu/drm/tegra/nvdec.c @@ -274,6 +274,8 @@ static int nvdec_load_falcon_firmware(struct nvdec *nvdec) return err; } else { virt = tegra_drm_alloc(tegra, size, &iova); + if (IS_ERR(virt)) + return PTR_ERR(virt); } nvdec->falcon.firmware.virt = virt;