aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorMaxin B John <maxin.john@gmail.com>2011-07-25 20:12:59 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-25 23:57:14 -0400
commitae891a1b93bf62e9aaa116a7a71312375047fc9f (patch)
tree83e821e818654da3e3443ecddd757665251db6e0 /kernel
parent5190f0c030f46b3169205f34f6d9ef480fa39ef2 (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 'kernel')
-rw-r--r--kernel/irq/devres.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/irq/devres.c b/kernel/irq/devres.c
index 1ef4ffcdfa55..bd8e788d71e0 100644
--- a/kernel/irq/devres.c
+++ b/kernel/irq/devres.c
@@ -87,8 +87,8 @@ void devm_free_irq(struct device *dev, unsigned int irq, void *dev_id)
87{ 87{
88 struct irq_devres match_data = { irq, dev_id }; 88 struct irq_devres match_data = { irq, dev_id };
89 89
90 free_irq(irq, dev_id);
91 WARN_ON(devres_destroy(dev, devm_irq_release, devm_irq_match, 90 WARN_ON(devres_destroy(dev, devm_irq_release, devm_irq_match,
92 &match_data)); 91 &match_data));
92 free_irq(irq, dev_id);
93} 93}
94EXPORT_SYMBOL(devm_free_irq); 94EXPORT_SYMBOL(devm_free_irq);