Skip to content

Commit 61b8d20

Browse files
cyndisgregkh
authored andcommitted
drm/tegra: nvdec: Fix dma_alloc_coherent error check
[ Upstream commit 44306a684cd1699b8562a54945ddc43e2abc9eab ] Check for NULL return value with dma_alloc_coherent, in line with Robin's fix for vic.c in 'drm/tegra: vic: Fix DMA API misuse'. Fixes: 46f226c ("drm/tegra: Add NVDEC driver") Signed-off-by: Mikko Perttunen <[email protected]> Signed-off-by: Thierry Reding <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sasha Levin <[email protected]>
1 parent adf08c9 commit 61b8d20

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/gpu/drm/tegra/nvdec.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,8 @@ static int nvdec_load_firmware(struct nvdec *nvdec)
209209

210210
if (!client->group) {
211211
virt = dma_alloc_coherent(nvdec->dev, size, &iova, GFP_KERNEL);
212-
213-
err = dma_mapping_error(nvdec->dev, iova);
214-
if (err < 0)
215-
return err;
212+
if (!virt)
213+
return -ENOMEM;
216214
} else {
217215
virt = tegra_drm_alloc(tegra, size, &iova);
218216
}

0 commit comments

Comments
 (0)