From 9cad6fb4e043ba6140d4c61f09ca0cf0ba8d18c0 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sat, 28 May 2005 20:36:22 +0000 Subject: Bugzilla #3217: Create a new __drm_pci_free which is used internally in linux-core to free pci memory without freeing the structure. Linux-core internals often create pci dma handle structures on the stack due to the lack of a drm_local_map_t to store them in properly. Fix the original drm_pci_free to actually free the dma handle structure instead of leaking it. Signed-off-by: Sergey Vlasov --- linux-core/drm_pci.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'linux-core/drm_pci.c') diff --git a/linux-core/drm_pci.c b/linux-core/drm_pci.c index 543c7704..dd9b0c8c 100644 --- a/linux-core/drm_pci.c +++ b/linux-core/drm_pci.c @@ -122,10 +122,12 @@ drm_dma_handle_t *drm_pci_alloc(drm_device_t * dev, size_t size, size_t align, EXPORT_SYMBOL(drm_pci_alloc); /** - * \brief Free a PCI consistent memory block. + * \brief Free a PCI consistent memory block without freeing its descriptor. + * + * This function is for internal use in the Linux-specific DRM core code. */ void -drm_pci_free(drm_device_t * dev, drm_dma_handle_t *dmah) +__drm_pci_free(drm_device_t * dev, drm_dma_handle_t *dmah) { #if 0 unsigned long addr; @@ -169,6 +171,16 @@ drm_pci_free(drm_device_t * dev, drm_dma_handle_t *dmah) #endif } + +/** + * \brief Free a PCI consistent memory block. + */ +void +drm_pci_free(drm_device_t * dev, drm_dma_handle_t *dmah) +{ + __drm_pci_free(dev, dmah); + kfree(dmah); +} EXPORT_SYMBOL(drm_pci_free); /*@}*/ -- cgit v1.2.3