Skip to content

Commit

Permalink
drm: fix leaked dma handles after removing drm_pci_free
Browse files Browse the repository at this point in the history
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 <joseph.kogut@gmail.com>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20210518212859.4148903-1-joseph.kogut@gmail.com
  • Loading branch information
Joseph Kogut authored and Thomas Zimmermann committed May 26, 2021
1 parent e0283ff commit 5562f75
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/drm_bufs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/r128/ati_pcigart.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 5562f75

Please sign in to comment.