Skip to content

Commit 2396eef

Browse files
zijun-huKAGA-KOKO
authored andcommitted
genirq/devres: Don't free interrupt which is not managed by devres
If devres_destroy() does not find a matching devres entry, then devm_free_irq() emits a warning and tries to free the interrupt. That's wrong as devm_free_irq() should only undo what devm_request_irq() set up. Replace devres_destroy() with a call to devres_release() which only invokes the release function (free_irq()) in case that a matching devres entry was found. [ tglx: Massaged change log ] Signed-off-by: Zijun Hu <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent bc88d44 commit 2396eef

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

kernel/irq/devres.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,8 @@ void devm_free_irq(struct device *dev, unsigned int irq, void *dev_id)
141141
{
142142
struct irq_devres match_data = { irq, dev_id };
143143

144-
WARN_ON(devres_destroy(dev, devm_irq_release, devm_irq_match,
144+
WARN_ON(devres_release(dev, devm_irq_release, devm_irq_match,
145145
&match_data));
146-
free_irq(irq, dev_id);
147146
}
148147
EXPORT_SYMBOL(devm_free_irq);
149148

0 commit comments

Comments
 (0)