ARM: imx: avic: Fix OF node reference leaks
Subsystems (3)
PATCH 1/1 ARM: imx: avic: Fix OF node reference leaks
of_find_compatible_node() returns a device node with its reference count incremented. mxc_init_irq() looks up the i.MX25 CCM node for of_iomap() and the AVIC node for irq_domain_create_legacy(), but does not release either temporary reference.
of_iomap() does not consume the node reference, and irq_domain_create_legacy() takes its own fwnode reference for the domain. Drop the temporary OF node references after each use.
--- arch/arm/mach-imx/avic.c | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/mach-imx/avic.c +2 -0
@@ -173,6 +173,7 @@ static void __init mxc_init_irq(void __iomem *irqbase) np =of_find_compatible_node (NULL ,NULL ,"fsl,imx25-ccm" ); mx25_ccm_base =of_iomap (np,0 ); +of_node_put (np);if (mx25_ccm_base) {/*
@@ -203,6 +204,7 @@ static void __init mxc_init_irq(void __iomem *irqbase) np =of_find_compatible_node (NULL ,NULL ,"fsl,avic" ); domain =irq_domain_create_legacy (of_fwnode_handle (np),AVIC_NUM_IRQS , irq_base,0 , &irq_domain_simple_ops,NULL ); +of_node_put (np);WARN_ON (!domain);for (i =0 ; i <AVIC_NUM_IRQS /32 ; i++, irq_base +=32 )
Signature · 1 line
2.43.0
[email protected]
AppliedFrom: Frank Li <[email protected]>
Quoted 10 lines · Yuho Choi
of_find_compatible_node()returns a device node with its reference count incremented.mxc_init_irq()looks up the i.MX25 CCM node forof_iomap()and the AVIC node forirq_domain_create_legacy(), but does not release either temporary reference.
of_iomap()does not consume the node reference, andirq_domain_create_legacy()takes its own fwnode reference for the domain. Drop the temporary OF node references after each use.[...]
Applied, thanks!
[1/1] ARM: imx: avic: Fix OF node reference leaks
commit: b24c12e1bad863d27141e4e9c19d25eebd68c4a6
Best regards,
Signature · 1 line
Frank Li <[email protected]>