dmaengine: fix memleak in dma_async_device_unregister
authorAnatolij Gustschin <agust@denx.de>
Tue, 26 Jan 2010 09:26:06 +0000 (10:26 +0100)
committerDan Williams <dan.j.williams@intel.com>
Tue, 2 Feb 2010 21:58:37 +0000 (14:58 -0700)
While debugging a dma driver I noticed a memleak after
unloading the driver module.

Caught by kmemleak.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Maciej Sosnowski <maciej.sosnowski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/dma/dmaengine.c

index 6f51a0a..e7a3230 100644 (file)
@@ -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);