All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regulator: qcom_smd: fix for_each_child.cocci warnings
@ 2022-01-15 11:11 ` Julia Lawall
  0 siblings, 0 replies; 5+ messages in thread
From: Julia Lawall @ 2022-01-15 11:11 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: kbuild-all, linux-kernel, Mark Brown, Andy Gross,
	Bjorn Andersson, Liam Girdwood, linux-arm-msm, linux-kernel

From: kernel test robot <lkp@intel.com>

drivers/regulator/qcom_smd-regulator.c:1318:1-33: WARNING: Function "for_each_available_child_of_node" should have of_node_put() before return around line 1321.


Semantic patch information:
 False positives can be due to function calls within the for_each
 loop that may encapsulate an of_node_put.

Generated by: scripts/coccinelle/iterators/for_each_child.cocci

Fixes: 14e2976fbabd ("regulator: qcom_smd: Align probe function with rpmh-regulator")
CC: Konrad Dybcio <konrad.dybcio@somainline.org>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   112450df61b7373529b0fe4c122ad13b89d80a8a
commit: 14e2976fbabdacb01335d7f91eeebbc89c67ddb1 regulator: qcom_smd: Align probe function with rpmh-regulator
:::::: branch date: 13 hours ago
:::::: commit date: 9 days ago

 qcom_smd-regulator.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/regulator/qcom_smd-regulator.c
+++ b/drivers/regulator/qcom_smd-regulator.c
@@ -1317,8 +1317,10 @@ static int rpm_reg_probe(struct platform

 	for_each_available_child_of_node(dev->of_node, node) {
 		vreg = devm_kzalloc(&pdev->dev, sizeof(*vreg), GFP_KERNEL);
-		if (!vreg)
+		if (!vreg) {
+			of_node_put(node);
 			return -ENOMEM;
+		}

 		ret = rpm_regulator_init_vreg(vreg, dev, node, rpm, vreg_data);


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

* [PATCH] regulator: qcom_smd: fix for_each_child.cocci warnings
@ 2022-01-15 11:11 ` Julia Lawall
  0 siblings, 0 replies; 5+ messages in thread
From: Julia Lawall @ 2022-01-15 11:11 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1546 bytes --]

From: kernel test robot <lkp@intel.com>

drivers/regulator/qcom_smd-regulator.c:1318:1-33: WARNING: Function "for_each_available_child_of_node" should have of_node_put() before return around line 1321.


Semantic patch information:
 False positives can be due to function calls within the for_each
 loop that may encapsulate an of_node_put.

Generated by: scripts/coccinelle/iterators/for_each_child.cocci

Fixes: 14e2976fbabd ("regulator: qcom_smd: Align probe function with rpmh-regulator")
CC: Konrad Dybcio <konrad.dybcio@somainline.org>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   112450df61b7373529b0fe4c122ad13b89d80a8a
commit: 14e2976fbabdacb01335d7f91eeebbc89c67ddb1 regulator: qcom_smd: Align probe function with rpmh-regulator
:::::: branch date: 13 hours ago
:::::: commit date: 9 days ago

 qcom_smd-regulator.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/regulator/qcom_smd-regulator.c
+++ b/drivers/regulator/qcom_smd-regulator.c
@@ -1317,8 +1317,10 @@ static int rpm_reg_probe(struct platform

 	for_each_available_child_of_node(dev->of_node, node) {
 		vreg = devm_kzalloc(&pdev->dev, sizeof(*vreg), GFP_KERNEL);
-		if (!vreg)
+		if (!vreg) {
+			of_node_put(node);
 			return -ENOMEM;
+		}

 		ret = rpm_regulator_init_vreg(vreg, dev, node, rpm, vreg_data);

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

* Re: [PATCH] regulator: qcom_smd: fix for_each_child.cocci warnings
  2022-01-15 11:11 ` Julia Lawall
@ 2022-01-25 10:20   ` Mark Brown
  -1 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2022-01-25 10:20 UTC (permalink / raw)
  To: Konrad Dybcio, Julia Lawall
  Cc: linux-kernel, kbuild-all, Bjorn Andersson, linux-arm-msm,
	Liam Girdwood, Andy Gross

On Sat, 15 Jan 2022 12:11:38 +0100 (CET), Julia Lawall wrote:
> From: kernel test robot <lkp@intel.com>
> 
> drivers/regulator/qcom_smd-regulator.c:1318:1-33: WARNING: Function "for_each_available_child_of_node" should have of_node_put() before return around line 1321.
> 
> 
> Semantic patch information:
>  False positives can be due to function calls within the for_each
>  loop that may encapsulate an of_node_put.
> 
> [...]

Applied to

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

Thanks!

[1/1] regulator: qcom_smd: fix for_each_child.cocci warnings
      commit: 6390d42c21efff0b4c10956a38e341f4e84ecd3d

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] 5+ messages in thread

* Re: [PATCH] regulator: qcom_smd: fix for_each_child.cocci warnings
@ 2022-01-25 10:20   ` Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2022-01-25 10:20 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1452 bytes --]

On Sat, 15 Jan 2022 12:11:38 +0100 (CET), Julia Lawall wrote:
> From: kernel test robot <lkp@intel.com>
> 
> drivers/regulator/qcom_smd-regulator.c:1318:1-33: WARNING: Function "for_each_available_child_of_node" should have of_node_put() before return around line 1321.
> 
> 
> Semantic patch information:
>  False positives can be due to function calls within the for_each
>  loop that may encapsulate an of_node_put.
> 
> [...]

Applied to

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

Thanks!

[1/1] regulator: qcom_smd: fix for_each_child.cocci warnings
      commit: 6390d42c21efff0b4c10956a38e341f4e84ecd3d

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] 5+ messages in thread

* [PATCH] regulator: qcom_smd: fix for_each_child.cocci warnings
  2022-01-15  4:48 drivers/regulator/qcom_smd-regulator.c:1318:1-33: WARNING: Function "for_each_available_child_of_node" should have of_node_put() before return around line 1321 kernel test robot
@ 2022-01-15  4:42 ` kernel test robot
  0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2022-01-15  4:42 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1918 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Konrad Dybcio <konrad.dybcio@somainline.org>
CC: Mark Brown <broonie@kernel.org>
CC: Andy Gross <agross@kernel.org>
CC: Bjorn Andersson <bjorn.andersson@linaro.org>
CC: Liam Girdwood <lgirdwood@gmail.com>
CC: linux-arm-msm(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/regulator/qcom_smd-regulator.c:1318:1-33: WARNING: Function "for_each_available_child_of_node" should have of_node_put() before return around line 1321.


Semantic patch information:
 False positives can be due to function calls within the for_each
 loop that may encapsulate an of_node_put.

Generated by: scripts/coccinelle/iterators/for_each_child.cocci

Fixes: 14e2976fbabd ("regulator: qcom_smd: Align probe function with rpmh-regulator")
CC: Konrad Dybcio <konrad.dybcio@somainline.org>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   112450df61b7373529b0fe4c122ad13b89d80a8a
commit: 14e2976fbabdacb01335d7f91eeebbc89c67ddb1 regulator: qcom_smd: Align probe function with rpmh-regulator
:::::: branch date: 13 hours ago
:::::: commit date: 9 days ago

Please take the patch only if it's a positive warning. Thanks!

 qcom_smd-regulator.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/regulator/qcom_smd-regulator.c
+++ b/drivers/regulator/qcom_smd-regulator.c
@@ -1317,8 +1317,10 @@ static int rpm_reg_probe(struct platform
 
 	for_each_available_child_of_node(dev->of_node, node) {
 		vreg = devm_kzalloc(&pdev->dev, sizeof(*vreg), GFP_KERNEL);
-		if (!vreg)
+		if (!vreg) {
+			of_node_put(node);
 			return -ENOMEM;
+		}
 
 		ret = rpm_regulator_init_vreg(vreg, dev, node, rpm, vreg_data);
 

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

end of thread, other threads:[~2022-01-25 10:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-15 11:11 [PATCH] regulator: qcom_smd: fix for_each_child.cocci warnings Julia Lawall
2022-01-15 11:11 ` Julia Lawall
2022-01-25 10:20 ` Mark Brown
2022-01-25 10:20   ` Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2022-01-15  4:48 drivers/regulator/qcom_smd-regulator.c:1318:1-33: WARNING: Function "for_each_available_child_of_node" should have of_node_put() before return around line 1321 kernel test robot
2022-01-15  4:42 ` [PATCH] regulator: qcom_smd: fix for_each_child.cocci warnings kernel test robot

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.