Skip to content

Commit afaa7b9

Browse files
Yuuoniybroonie
authored andcommitted
regulator: pfuze100: Fix refcount leak in pfuze_parse_regulators_dt
of_node_get() returns a node with refcount incremented. Calling of_node_put() to drop the reference when not needed anymore. Fixes: 3784b6d ("regulator: pfuze100: add pfuze100 regulator driver") Signed-off-by: Miaoqian Lin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent ac87e58 commit afaa7b9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/regulator/pfuze100-regulator.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,7 @@ static int pfuze_parse_regulators_dt(struct pfuze_chip *chip)
521521
parent = of_get_child_by_name(np, "regulators");
522522
if (!parent) {
523523
dev_err(dev, "regulators node not found\n");
524+
of_node_put(np);
524525
return -EINVAL;
525526
}
526527

@@ -550,6 +551,7 @@ static int pfuze_parse_regulators_dt(struct pfuze_chip *chip)
550551
}
551552

552553
of_node_put(parent);
554+
of_node_put(np);
553555
if (ret < 0) {
554556
dev_err(dev, "Error parsing regulator init data: %d\n",
555557
ret);

0 commit comments

Comments
 (0)