]> git.baikalelectronics.ru Git - kernel.git/commit
drm/tegra: vic: Fix DMA API misuse
authorRobin Murphy <robin.murphy@arm.com>
Fri, 10 Dec 2021 17:54:44 +0000 (17:54 +0000)
committerThierry Reding <treding@nvidia.com>
Thu, 16 Dec 2021 13:07:07 +0000 (14:07 +0100)
commitd2ba613bb2d8b051c8ada8951d73791c988de287
tree497aa95c53205f1c64e48cdc9307abebae9fd065
parent0c1d9c25909bdca1c44b9141f3c6686bb7ad23ee
drm/tegra: vic: Fix DMA API misuse

Upon failure, dma_alloc_coherent() returns NULL. If that does happen,
passing some uninitialised stack contents to dma_mapping_error() - which
belongs to a different API in the first place - has precious little
chance of detecting it.

Also include the correct header, because the fragile transitive
inclusion currently providing it is going to break soon.

Fixes: 4c1584d20446 ("drm/tegra: Remove memory allocation from Falcon library")
CC: Thierry Reding <thierry.reding@gmail.com>
CC: Mikko Perttunen <mperttunen@nvidia.com>
CC: dri-devel@lists.freedesktop.org
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/drm/tegra/vic.c