Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/etnaviv: fix MMU context leak on GPU reset

After a reset the GPU is no longer using the MMU context and may be
restarted with a different context. While the mmu_state proeprly was
cleared, the context wasn't unreferenced, leading to a memory leak.

Cc: stable@vger.kernel.org # 5.4
Reported-by: Michael Walle <michael@walle.cc>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Michael Walle <michael@walle.cc>
Tested-by: Marek Vasut <marex@denx.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>

+2
+2
drivers/gpu/drm/etnaviv/etnaviv_gpu.c
··· 571 571 572 572 gpu->fe_running = false; 573 573 gpu->exec_state = -1; 574 + if (gpu->mmu_context) 575 + etnaviv_iommu_context_put(gpu->mmu_context); 574 576 gpu->mmu_context = NULL; 575 577 576 578 return 0;