Skip to contentSkip to conversation

regulator: qcom_smd: fix for_each_child.cocci warnings

PATCH In review Julia Lawall 2 participants 2 messages Jan 15, 2022 – Jan 25, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 regulator: qcom_smd: fix for_each_child.cocci warnings

From: kernel test robot <[email protected]>

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 <[email protected]>

---

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(-)
drivers/regulator/qcom_smd-regulator.c +3 -1
@@ -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);
maintainer
#1 lore raw
Quoted 10 lines · Julia Lawall

From: kernel test robot <[email protected]>

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