Commit 676fe1f6 authored by Joe Hattori's avatar Joe Hattori Committed by Damien Le Moal
Browse files

ata: sata_highbank: fix OF node reference leak in highbank_initialize_phys()



The OF node reference obtained by of_parse_phandle_with_args() is not
released on early return. Add a of_node_put() call before returning.

Fixes: 8996b89d ("ata: add platform driver for Calxeda AHCI controller")
Signed-off-by: default avatarJoe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Signed-off-by: default avatarDamien Le Moal <dlemoal@kernel.org>
parent fac04efc
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -348,6 +348,7 @@ static int highbank_initialize_phys(struct device *dev, void __iomem *addr)
			phy_nodes[phy] = phy_data.np;
			cphy_base[phy] = of_iomap(phy_nodes[phy], 0);
			if (cphy_base[phy] == NULL) {
				of_node_put(phy_data.np);
				return 0;
			}
			phy_count += 1;