mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 06:10:56 +00:00
ARM: cns3xxx: Fix refcount leak in cns3xxx_init
commit1ba904b6b1
upstream. 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:415f59142d
("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
71e12e5b02
commit
68d4303bf5
1 changed files with 2 additions and 0 deletions
|
@ -379,6 +379,7 @@ static void __init cns3xxx_init(void)
|
||||||
/* De-Asscer SATA Reset */
|
/* De-Asscer SATA Reset */
|
||||||
cns3xxx_pwr_soft_rst(CNS3XXX_PWR_SOFTWARE_RST(SATA));
|
cns3xxx_pwr_soft_rst(CNS3XXX_PWR_SOFTWARE_RST(SATA));
|
||||||
}
|
}
|
||||||
|
of_node_put(dn);
|
||||||
|
|
||||||
dn = of_find_compatible_node(NULL, NULL, "cavium,cns3420-sdhci");
|
dn = of_find_compatible_node(NULL, NULL, "cavium,cns3420-sdhci");
|
||||||
if (of_device_is_available(dn)) {
|
if (of_device_is_available(dn)) {
|
||||||
|
@ -392,6 +393,7 @@ static void __init cns3xxx_init(void)
|
||||||
cns3xxx_pwr_clk_en(CNS3XXX_PWR_CLK_EN(SDIO));
|
cns3xxx_pwr_clk_en(CNS3XXX_PWR_CLK_EN(SDIO));
|
||||||
cns3xxx_pwr_soft_rst(CNS3XXX_PWR_SOFTWARE_RST(SDIO));
|
cns3xxx_pwr_soft_rst(CNS3XXX_PWR_SOFTWARE_RST(SDIO));
|
||||||
}
|
}
|
||||||
|
of_node_put(dn);
|
||||||
|
|
||||||
pm_power_off = cns3xxx_power_off;
|
pm_power_off = cns3xxx_power_off;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue