diff options
author | Julia Lawall <julia@diku.dk> | 2009-12-22 15:30:59 -0500 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2009-12-22 17:30:08 -0500 |
commit | 0794ec8ce327ec74416b569b8fb1951274693700 (patch) | |
tree | 4e6a59cdf0c13005d22165932b82acf1213bc937 /drivers/dma/coh901318.c | |
parent | 1e9d1b13efae7e0a2705611d47ae5f07e27015f0 (diff) |
drivers/dma: Correct use after free
Move the kfree after the iounmap that refers to the same structure.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression x,e;
identifier f;
iterator I;
statement S;
@@
*kfree(x);
... when != &x
when != x = e
when != I(x,...) S
*x->f
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma/coh901318.c')
-rw-r--r-- | drivers/dma/coh901318.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/dma/coh901318.c b/drivers/dma/coh901318.c index 4a99cd94536b..b5f2ee0f8e2c 100644 --- a/drivers/dma/coh901318.c +++ b/drivers/dma/coh901318.c | |||
@@ -1294,8 +1294,8 @@ static int __exit coh901318_remove(struct platform_device *pdev) | |||
1294 | dma_async_device_unregister(&base->dma_slave); | 1294 | dma_async_device_unregister(&base->dma_slave); |
1295 | coh901318_pool_destroy(&base->pool); | 1295 | coh901318_pool_destroy(&base->pool); |
1296 | free_irq(platform_get_irq(pdev, 0), base); | 1296 | free_irq(platform_get_irq(pdev, 0), base); |
1297 | kfree(base); | ||
1298 | iounmap(base->virtbase); | 1297 | iounmap(base->virtbase); |
1298 | kfree(base); | ||
1299 | release_mem_region(pdev->resource->start, | 1299 | release_mem_region(pdev->resource->start, |
1300 | resource_size(pdev->resource)); | 1300 | resource_size(pdev->resource)); |
1301 | return 0; | 1301 | return 0; |