linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] regulator: add missing call to of_node_put()
@ 2021-02-25  9:07 Yang Li
  2021-02-25 12:04 ` Cristian Marussi
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yang Li @ 2021-02-25  9:07 UTC (permalink / raw)
  To: sudeep.holla
  Cc: lgirdwood, linux-kernel, broonie, Yang Li, cristian.marussi,
	linux-arm-kernel

In one of the error paths of the for_each_child_of_node() loop,
add missing call to of_node_put().

Fix the following coccicheck warning:
./drivers/regulator/scmi-regulator.c:343:1-23: WARNING: Function
"for_each_child_of_node" should have of_node_put() before return around
line 347.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 drivers/regulator/scmi-regulator.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/regulator/scmi-regulator.c b/drivers/regulator/scmi-regulator.c
index 0e8b3ca..a41bb06 100644
--- a/drivers/regulator/scmi-regulator.c
+++ b/drivers/regulator/scmi-regulator.c
@@ -344,6 +344,7 @@ static int scmi_regulator_probe(struct scmi_device *sdev)
 		ret = process_scmi_regulator_of_node(sdev, child, rinfo);
 		/* abort on any mem issue */
 		if (ret == -ENOMEM)
+			of_node_put(child);
 			return ret;
 	}
 
-- 
1.8.3.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2021-02-25 13:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-25  9:07 [PATCH] regulator: add missing call to of_node_put() Yang Li
2021-02-25 12:04 ` Cristian Marussi
2021-02-25 13:17 ` kernel test robot
2021-02-25 13:39 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).