Skip to content

Commit 6390d42

Browse files
intel-lab-lkpbroonie
authored andcommitted
regulator: qcom_smd: fix for_each_child.cocci warnings
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: 14e2976 ("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> Link: https://lore.kernel.org/r/alpine.DEB.2.22.394.2201151210170.3051@hadrien Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 799f9cf commit 6390d42

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/regulator/qcom_smd-regulator.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1317,8 +1317,10 @@ static int rpm_reg_probe(struct platform_device *pdev)
13171317

13181318
for_each_available_child_of_node(dev->of_node, node) {
13191319
vreg = devm_kzalloc(&pdev->dev, sizeof(*vreg), GFP_KERNEL);
1320-
if (!vreg)
1320+
if (!vreg) {
1321+
of_node_put(node);
13211322
return -ENOMEM;
1323+
}
13221324

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

0 commit comments

Comments
 (0)