[tip:irq/urgent] irqchip/atmel-aic: Fix unbalanced refcount in aic_common_rtc_irq_fixup()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  277867ade8262583f4280cadbe90e0031a3706a7
Gitweb:     http://git.kernel.org/tip/277867ade8262583f4280cadbe90e0031a3706a7
Author:     Boris Brezillon <boris.brezillon@xxxxxxxxxxxxxxxxxx>
AuthorDate: Tue, 4 Jul 2017 11:10:40 +0200
Committer:  Marc Zyngier <marc.zyngier@xxxxxxx>
CommitDate: Tue, 4 Jul 2017 11:10:36 +0100

irqchip/atmel-aic: Fix unbalanced refcount in aic_common_rtc_irq_fixup()

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@xxxxxxxxxxxxxxxxxx>
Reported-by: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxxxxxxxxx>
Fixes: 3d61467f9bab ("irqchip: atmel-aic: Implement RTC irq fixup")
Cc: <stable@xxxxxxxxxxxxxxx>
Signed-off-by: Marc Zyngier <marc.zyngier@xxxxxxx>
---
 drivers/irqchip/irq-atmel-aic-common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/irqchip/irq-atmel-aic-common.c b/drivers/irqchip/irq-atmel-aic-common.c
index 7c5a434..0565070 100644
--- a/drivers/irqchip/irq-atmel-aic-common.c
+++ b/drivers/irqchip/irq-atmel-aic-common.c
@@ -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)



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]