diff options
author | Maxin B John <maxin.john@gmail.com> | 2011-07-25 20:12:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-25 23:57:14 -0400 |
commit | ae891a1b93bf62e9aaa116a7a71312375047fc9f (patch) | |
tree | 83e821e818654da3e3443ecddd757665251db6e0 /mm/dmapool.c | |
parent | 5190f0c030f46b3169205f34f6d9ef480fa39ef2 (diff) |
devres: fix possible use after free
devres uses the pointer value as key after it's freed, which is safe but
triggers spurious use-after-free warnings on some static analysis tools.
Rearrange code to avoid such warnings.
Signed-off-by: Maxin B. John <maxin.john@gmail.com>
Reviewed-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/dmapool.c')
-rw-r--r-- | mm/dmapool.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/dmapool.c b/mm/dmapool.c index 03bf3bb4519a..fbb58e346888 100644 --- a/mm/dmapool.c +++ b/mm/dmapool.c | |||
@@ -500,7 +500,7 @@ void dmam_pool_destroy(struct dma_pool *pool) | |||
500 | { | 500 | { |
501 | struct device *dev = pool->dev; | 501 | struct device *dev = pool->dev; |
502 | 502 | ||
503 | dma_pool_destroy(pool); | ||
504 | WARN_ON(devres_destroy(dev, dmam_pool_release, dmam_pool_match, pool)); | 503 | WARN_ON(devres_destroy(dev, dmam_pool_release, dmam_pool_match, pool)); |
504 | dma_pool_destroy(pool); | ||
505 | } | 505 | } |
506 | EXPORT_SYMBOL(dmam_pool_destroy); | 506 | EXPORT_SYMBOL(dmam_pool_destroy); |