Skip to content

Commit 676fe1f

Browse files
joehattoridamien-lemoal
authored andcommitted
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: 8996b89 ("ata: add platform driver for Calxeda AHCI controller") Signed-off-by: Joe Hattori <[email protected]> Signed-off-by: Damien Le Moal <[email protected]>
1 parent fac04ef commit 676fe1f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/ata/sata_highbank.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ static int highbank_initialize_phys(struct device *dev, void __iomem *addr)
348348
phy_nodes[phy] = phy_data.np;
349349
cphy_base[phy] = of_iomap(phy_nodes[phy], 0);
350350
if (cphy_base[phy] == NULL) {
351+
of_node_put(phy_data.np);
351352
return 0;
352353
}
353354
phy_count += 1;

0 commit comments

Comments
 (0)