mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-11 05:17:10 +09:00
media: exynos4-is: Free FIMC-IS CPU memory only when allocated
commit 404a90abc6 upstream.
Ensure dma_free_coherent() is not called with incorrect arguments
and only when the memory was actually allocated. This will prevent
possible crashes on error paths of the top level media device driver,
when fimc-is device gets unregistered and its driver detached.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
5a77f6628b
commit
30520611a4
@@ -367,6 +367,9 @@ static void fimc_is_free_cpu_memory(struct fimc_is *is)
|
||||
{
|
||||
struct device *dev = &is->pdev->dev;
|
||||
|
||||
if (is->memory.vaddr == NULL)
|
||||
return;
|
||||
|
||||
dma_free_coherent(dev, is->memory.size, is->memory.vaddr,
|
||||
is->memory.paddr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user