drm: fix leaked dma handles after removing drm_pci_free
Subsystems (2)
PATCH 1/1 drm: fix leaked dma handles after removing drm_pci_free
After removing drm_pci_alloc/free, some instances where drm_pci_free() would have kfreed the dma handle were skipped.
Ensure these handles are freed properly.
Signed-off-by Joseph Kogut <[email protected]>
--- drivers/gpu/drm/drm_bufs.c | 1 + drivers/gpu/drm/r128/ati_pcigart.c | 2 ++ 2 files changed, 3 insertions(+)
drivers/gpu/drm/drm_bufs.c +1 -0
@@ -685,6 +685,7 @@ static void drm_cleanup_buf_error(struct drm_device *dev, dmah->size, dmah->vaddr, dmah->busaddr); +kfree (dmah); } }kfree (entry->seglist);
drivers/gpu/drm/r128/ati_pcigart.c +2 -0
@@ -71,6 +71,8 @@ static void drm_ati_free_pcigart_table(struct drm_device *dev,drm_dma_handle_t *dmah = gart_info->table_handle;dma_free_coherent (dev->dev, dmah->size, dmah->vaddr, dmah->busaddr); +kfree (dmah); + gart_info->table_handle =NULL ; }
Signature · 1 line
2.31.1
Am 18.05.21 um 23:28 schrieb Joseph Kogut:
Quoted 6 lines
After removing drm_pci_alloc/free, some instances where
drm_pci_free()would have kfreed the dma handle were skipped.Ensure these handles are freed properly.
Signed-off-by Joseph Kogut <[email protected]>
Applied to drm-misc-next. Thanks
Best regards
Thomas
Quoted 31 lines
--- drivers/gpu/drm/drm_bufs.c | 1 + drivers/gpu/drm/r128/ati_pcigart.c | 2 ++ 2 files changed, 3 insertions(+)drivers/gpu/drm/drm_bufs.c +1
-0@@ -685,6 +685,7 @@ static void drm_cleanup_buf_error(struct drm_device *dev, dmah->size, dmah->vaddr, dmah->busaddr); +kfree (dmah); } }kfree (entry->seglist);drivers/gpu/drm/r128/ati_pcigart.c +2
-0@@ -71,6 +71,8 @@ static void drm_ati_free_pcigart_table(struct drm_device *dev,drm_dma_handle_t *dmah = gart_info->table_handle;dma_free_coherent (dev->dev, dmah->size, dmah->vaddr, dmah->busaddr); +kfree (dmah); + gart_info->table_handle =NULL ; }
Signature · 6 lines
Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Felix Imendörffer