accel/qaic: Fix dma_free_attrs() buffer size
Subsystems (5)
PATCH 1/1 accel/qaic: Fix dma_free_attrs() buffer size
The gpummu->table buffer is alloc'd with size TABLE_SIZE + 32 in a2xx_gpummu_new() but freed with size TABLE_SIZE in a2xx_gpummu_destroy().
Change the free size to match the allocation.
Fixes c2052a4e5c99 ("drm/msm: implement a2xx mmu")
Cc <[email protected]>
Signed-off-by Thomas Fourier <[email protected]>
--- drivers/gpu/drm/msm/adreno/a2xx_gpummu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/msm/adreno/a2xx_gpummu.c +1 -1
@@ -78,7 +78,7 @@ static void a2xx_gpummu_destroy(struct msm_mmu *mmu) {struct a2xx_gpummu *gpummu =to_a2xx_gpummu (mmu); -dma_free_attrs (mmu->dev,TABLE_SIZE , gpummu->table, gpummu->pt_base, +dma_free_attrs (mmu->dev,TABLE_SIZE +32 , gpummu->table, gpummu->pt_base,DMA_ATTR_FORCE_CONTIGUOUS );kfree (gpummu);
Signature · 1 line
2.43.0
Quoted 4 lines · Thomas Fourier
The
gpummu->tablebuffer is alloc'd with sizeTABLE_SIZE+ 32 ina2xx_gpummu_new()but freed with sizeTABLE_SIZEina2xx_gpummu_destroy().
Quoted 9 lines
Change the free size to match the allocation.
Fixes c2052a4e5c99 ("drm/msm: implement a2xx mmu")Cc <[email protected]>Signed-off-by Thomas Fourier <[email protected]>--- drivers/gpu/drm/msm/adreno/a2xx_gpummu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Note, your subject is preffix is wrong. Could you please correct it?
Quoted 16 lines
drivers/gpu/drm/msm/adreno/a2xx_gpummu.c +1
-1@@ -78,7 +78,7 @@ static void a2xx_gpummu_destroy(struct msm_mmu *mmu) {struct a2xx_gpummu *gpummu =to_a2xx_gpummu (mmu); -dma_free_attrs (mmu->dev,TABLE_SIZE , gpummu->table, gpummu->pt_base, +dma_free_attrs (mmu->dev,TABLE_SIZE +32 , gpummu->table, gpummu->pt_base,DMA_ATTR_FORCE_CONTIGUOUS );kfree (gpummu);Signature · 1 line
2.43.0
Signature · 2 lines
With best wishes Dmitry