Skip to content

Commit 44306a6

Browse files
cyndisthierryreding
authored andcommitted
drm/tegra: nvdec: Fix dma_alloc_coherent error check
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]
1 parent 2e9fdbe commit 44306a6

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
@@ -261,10 +261,8 @@ static int nvdec_load_falcon_firmware(struct nvdec *nvdec)
261261

262262
if (!client->group) {
263263
virt = dma_alloc_coherent(nvdec->dev, size, &iova, GFP_KERNEL);
264-
265-
err = dma_mapping_error(nvdec->dev, iova);
266-
if (err < 0)
267-
return err;
264+
if (!virt)
265+
return -ENOMEM;
268266
} else {
269267
virt = tegra_drm_alloc(tegra, size, &iova);
270268
if (IS_ERR(virt))

0 commit comments

Comments
 (0)