mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] regulator: pfuze100: Fix refcount leak in pfuze_parse_regulators_dt
@ 2022-05-11 11:35 Miaoqian Lin
  2022-05-11 18:26 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Miaoqian Lin @ 2022-05-11 11:35 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Robin Gong, linux-kernel; +Cc: linmq006

of_node_get() returns a node with refcount incremented.
Calling of_node_put() to drop the reference when not needed anymore.

Fixes: 3784b6d64dc5 ("regulator: pfuze100: add pfuze100 regulator driver")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 drivers/regulator/pfuze100-regulator.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/regulator/pfuze100-regulator.c b/drivers/regulator/pfuze100-regulator.c
index d60d7d1b7fa2..aa55cfca9e40 100644
--- a/drivers/regulator/pfuze100-regulator.c
+++ b/drivers/regulator/pfuze100-regulator.c
@@ -521,6 +521,7 @@ static int pfuze_parse_regulators_dt(struct pfuze_chip *chip)
 	parent = of_get_child_by_name(np, "regulators");
 	if (!parent) {
 		dev_err(dev, "regulators node not found\n");
+		of_node_put(np);
 		return -EINVAL;
 	}
 
@@ -550,6 +551,7 @@ static int pfuze_parse_regulators_dt(struct pfuze_chip *chip)
 	}
 
 	of_node_put(parent);
+	of_node_put(np);
 	if (ret < 0) {
 		dev_err(dev, "Error parsing regulator init data: %d\n",
 			ret);
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] regulator: pfuze100: Fix refcount leak in pfuze_parse_regulators_dt
  2022-05-11 11:35 [PATCH] regulator: pfuze100: Fix refcount leak in pfuze_parse_regulators_dt Miaoqian Lin
@ 2022-05-11 18:26 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2022-05-11 18:26 UTC (permalink / raw)
  To: linmq006, linux-kernel, b38343, lgirdwood

On Wed, 11 May 2022 15:35:05 +0400, Miaoqian Lin wrote:
> of_node_get() returns a node with refcount incremented.
> Calling of_node_put() to drop the reference when not needed anymore.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next

Thanks!

[1/1] regulator: pfuze100: Fix refcount leak in pfuze_parse_regulators_dt
      commit: afaa7b933ef00a2d3262f4d1252087613fb5c06d

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-11 18:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-11 11:35 [PATCH] regulator: pfuze100: Fix refcount leak in pfuze_parse_regulators_dt Miaoqian Lin
2022-05-11 18:26 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®