From: Thierry Reding Date: Thu, 16 Dec 2021 08:56:11 +0000 (+0100) Subject: drm/tegra: vic: Handle tegra_drm_alloc() failure X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=d53830eec05561a0e9918fff8df3861bde74d159;p=linux.git drm/tegra: vic: Handle tegra_drm_alloc() failure This function can return one of several errors in an ERR_PTR()-encoded pointer, so make sure to propogate those on failure. Suggested-by: Robin Murphy Signed-off-by: Thierry Reding --- diff --git a/drivers/gpu/drm/tegra/vic.c b/drivers/gpu/drm/tegra/vic.c index c5f4d2b13c436..7d2b719ed8d1a 100644 --- a/drivers/gpu/drm/tegra/vic.c +++ b/drivers/gpu/drm/tegra/vic.c @@ -237,6 +237,8 @@ static int vic_load_firmware(struct vic *vic) return -ENOMEM; } else { virt = tegra_drm_alloc(tegra, size, &iova); + if (IS_ERR(virt)) + return PTR_ERR(virt); } vic->falcon.firmware.virt = virt;