mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 00:20:32 +00:00
regulator: pfuze100: Fix refcount leak in pfuze_parse_regulators_dt
[ Upstream commitafaa7b933e
] of_node_get() returns a node with refcount incremented. Calling of_node_put() to drop the reference when not needed anymore. Fixes:3784b6d64d
("regulator: pfuze100: add pfuze100 regulator driver") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Link: https://lore.kernel.org/r/20220511113506.45185-1-linmq006@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
18b907ff0a
commit
0be5d9da57
1 changed files with 2 additions and 0 deletions
|
@ -528,6 +528,7 @@ static int pfuze_parse_regulators_dt(struct pfuze_chip *chip)
|
||||||
parent = of_get_child_by_name(np, "regulators");
|
parent = of_get_child_by_name(np, "regulators");
|
||||||
if (!parent) {
|
if (!parent) {
|
||||||
dev_err(dev, "regulators node not found\n");
|
dev_err(dev, "regulators node not found\n");
|
||||||
|
of_node_put(np);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -557,6 +558,7 @@ static int pfuze_parse_regulators_dt(struct pfuze_chip *chip)
|
||||||
}
|
}
|
||||||
|
|
||||||
of_node_put(parent);
|
of_node_put(parent);
|
||||||
|
of_node_put(np);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
dev_err(dev, "Error parsing regulator init data: %d\n",
|
dev_err(dev, "Error parsing regulator init data: %d\n",
|
||||||
ret);
|
ret);
|
||||||
|
|
Loading…
Reference in a new issue