Skip to content

Commit

Permalink
irqchip/atmel-aic: Fix unbalanced refcount in aic_common_rtc_irq_fixup()
Browse files Browse the repository at this point in the history
of_find_compatible_node() is calling of_node_put() on its first argument
thus leading to an unbalanced of_node_get/put() issue if the node has not
been retained before that.

Instead of passing the root node, pass NULL, which does exactly the same:
iterate over all DT nodes, starting from the root node.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Reported-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Fixes: 3d61467 ("irqchip: atmel-aic: Implement RTC irq fixup")
Cc: <stable@vger.kernel.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
  • Loading branch information
Boris Brezillon authored and Marc Zyngier committed Jul 4, 2017
1 parent 469bcef commit 277867a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/irqchip/irq-atmel-aic-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ void __init aic_common_rtc_irq_fixup(struct device_node *root)
struct device_node *np;
void __iomem *regs;

np = of_find_compatible_node(root, NULL, "atmel,at91rm9200-rtc");
np = of_find_compatible_node(NULL, NULL, "atmel,at91rm9200-rtc");
if (!np)
np = of_find_compatible_node(root, NULL,
np = of_find_compatible_node(NULL, NULL,
"atmel,at91sam9x5-rtc");

if (!np)
Expand Down

0 comments on commit 277867a

Please sign in to comment.