diff mbox series

[1/2] drm/tegra: Add error check for NVDEC firmware memory allocation

Message ID 20230413082202.114721-1-cyndis@kapsi.fi (mailing list archive)
State New, archived
Headers show
Series [1/2] drm/tegra: Add error check for NVDEC firmware memory allocation | expand

Commit Message

Mikko Perttunen April 13, 2023, 8:22 a.m. UTC
From: Mikko Perttunen <mperttunen@nvidia.com>

The return value for tegra_drm_alloc was missing an error check.
Add one.

Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
---
 drivers/gpu/drm/tegra/nvdec.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/tegra/nvdec.c b/drivers/gpu/drm/tegra/nvdec.c
index ae78a81e5eef..15ce5e89fad4 100644
--- a/drivers/gpu/drm/tegra/nvdec.c
+++ b/drivers/gpu/drm/tegra/nvdec.c
@@ -276,6 +276,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;