All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regulator: s5m8767: Drop regulators OF node reference
@ 2021-01-21 15:59 Krzysztof Kozlowski
  2021-01-21 19:40 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Krzysztof Kozlowski @ 2021-01-21 15:59 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Bartlomiej Zolnierkiewicz, Liam Girdwood,
	Mark Brown, linux-kernel, linux-samsung-soc
  Cc: Pan Bian

The device node reference obtained with of_get_child_by_name() should be
dropped on error paths.

Fixes: 26aec009f6b6 ("regulator: add device tree support for s5m8767")
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/regulator/s5m8767.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index 3fa472127e9a..fa10f1f550a4 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -544,14 +544,18 @@ static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev,
 	rdata = devm_kcalloc(&pdev->dev,
 			     pdata->num_regulators, sizeof(*rdata),
 			     GFP_KERNEL);
-	if (!rdata)
+	if (!rdata) {
+		of_node_put(regulators_np);
 		return -ENOMEM;
+	}
 
 	rmode = devm_kcalloc(&pdev->dev,
 			     pdata->num_regulators, sizeof(*rmode),
 			     GFP_KERNEL);
-	if (!rmode)
+	if (!rmode) {
+		of_node_put(regulators_np);
 		return -ENOMEM;
+	}
 
 	pdata->regulators = rdata;
 	pdata->opmode = rmode;
-- 
2.25.1


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

* Re: [PATCH] regulator: s5m8767: Drop regulators OF node reference
  2021-01-21 15:59 [PATCH] regulator: s5m8767: Drop regulators OF node reference Krzysztof Kozlowski
@ 2021-01-21 19:40 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2021-01-21 19:40 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Liam Girdwood, linux-kernel,
	linux-samsung-soc, Bartlomiej Zolnierkiewicz
  Cc: Pan Bian

On Thu, 21 Jan 2021 16:59:14 +0100, Krzysztof Kozlowski wrote:
> The device node reference obtained with of_get_child_by_name() should be
> dropped on error paths.

Applied to

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

Thanks!

[1/1] regulator: s5m8767: Drop regulators OF node reference
      commit: a5872bd3398d0ff2ce4c77794bc7837899c69024

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:[~2021-01-21 19:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-21 15:59 [PATCH] regulator: s5m8767: Drop regulators OF node reference Krzysztof Kozlowski
2021-01-21 19:40 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.