Skip to contentSkip to conversation

drm/tegra: vic: Handle tegra_drm_alloc() failure

PATCH New Thierry Reding 1 participant 1 message Dec 16, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/tegra: vic: Handle tegra_drm_alloc() failure

From: Thierry Reding <[email protected]>

This function can return one of several errors in an ERR_PTR()-encoded pointer, so make sure to propogate those on failure.

---
 drivers/gpu/drm/tegra/vic.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/tegra/vic.c +2 -0
index c5f4d2b13c43..7d2b719ed8d1 100644
@@ -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;
Signature · 1 line
2.34.1