Skip to content

Commit 1ba904b

Browse files
Yuuoniyarndb
authored andcommitted
ARM: cns3xxx: Fix refcount leak in cns3xxx_init
of_find_compatible_node() returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak. Fixes: 415f591 ("ARM: cns3xxx: initial DT support") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Acked-by: Krzysztof Halasa <khalasa@piap.pl> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
1 parent 17b1362 commit 1ba904b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/arm/mach-cns3xxx/core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,7 @@ static void __init cns3xxx_init(void)
372372
/* De-Asscer SATA Reset */
373373
cns3xxx_pwr_soft_rst(CNS3XXX_PWR_SOFTWARE_RST(SATA));
374374
}
375+
of_node_put(dn);
375376

376377
dn = of_find_compatible_node(NULL, NULL, "cavium,cns3420-sdhci");
377378
if (of_device_is_available(dn)) {
@@ -385,6 +386,7 @@ static void __init cns3xxx_init(void)
385386
cns3xxx_pwr_clk_en(CNS3XXX_PWR_CLK_EN(SDIO));
386387
cns3xxx_pwr_soft_rst(CNS3XXX_PWR_SOFTWARE_RST(SDIO));
387388
}
389+
of_node_put(dn);
388390

389391
pm_power_off = cns3xxx_power_off;
390392

0 commit comments

Comments
 (0)