Skip to contentSkip to conversation

dmaengine: fix memleak in dma_async_device_unregister

PATCH New Anatolij Gustschin 1 participant 1 message Jan 26, 2010 dmaengine

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dmaengine: fix memleak in dma_async_device_unregister

While debugging a dma driver I noticed a memleak after unloading the driver module.

Caught by kmemleak.

Cc Maciej Sosnowski <[email protected]>
Cc Dan Williams <[email protected]>
---
 drivers/dma/dmaengine.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/dma/dmaengine.c +1 -0
index 6f51a0a..e7a3230 100644
@@ -826,6 +826,7 @@ void dma_async_device_unregister(struct dma_device *device)
 		chan->dev->chan = NULL;
 		mutex_unlock(&dma_list_mutex);
 		device_unregister(&chan->dev->device);
+		free_percpu(chan->local);
 	}
 }
 EXPORT_SYMBOL(dma_async_device_unregister);
Signature · 1 line
1.6.2.5