All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [PATCH] iio: versal-sysmon: fix for_each_child.cocci warnings
Date: Thu, 10 Feb 2022 03:37:28 +0800	[thread overview]
Message-ID: <20220209193728.GA83871@d9df6f5d589d> (raw)
In-Reply-To: <202202100352.j4CqVkcK-lkp@intel.com>

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

CC: kbuild-all(a)lists.01.org
CC: linux-arm-kernel(a)lists.infradead.org
TO: Anand Ashok Dumbre <anand.ashok.dumbre@xilinx.com>
CC: Michal Simek <monstr@monstr.eu>
CC: Dragan Cvetic <dragan.cvetic@xilinx.com>
CC: Jonathan Cameron <jic23@kernel.org>
CC: "Lars-Peter Clausen" <lars@metafoo.de>
CC: git(a)xilinx.com
CC: linux-iio(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

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

drivers/iio/adc/versal-sysmon.c:876:1-23: WARNING: Function "for_each_child_of_node" should have of_node_put() before return around line 879.
drivers/iio/adc/versal-sysmon.c:876:1-23: WARNING: Function "for_each_child_of_node" should have of_node_put() before return around line 883.


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

CC: Anand Ashok Dumbre <anand.ashok.dumbre@xilinx.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.15
head:   423a108a01e05e84b59a4c4885c16bf3cd8c90c7
commit: 1459646ab280aa68c3c4fa1d9552ea21f15d7a2d [543/907] iio: versal-sysmon: add driver for Versal Sysmon
:::::: branch date: 10 hours ago
:::::: commit date: 9 days ago

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

 versal-sysmon.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

--- a/drivers/iio/adc/versal-sysmon.c
+++ b/drivers/iio/adc/versal-sysmon.c
@@ -875,12 +875,16 @@ static int sysmon_parse_dt(struct iio_de
 
 	for_each_child_of_node(np, child_node) {
 		ret = of_property_read_u32(child_node, "reg", &reg);
-		if (ret < 0)
+		if (ret < 0) {
+			of_node_put(child_node);
 			return ret;
+		}
 
 		ret = of_property_read_string(child_node, "xlnx,name", &name);
-		if (ret < 0)
+		if (ret < 0) {
+			of_node_put(child_node);
 			return ret;
+		}
 
 		sysmon_channels[i].type = IIO_VOLTAGE;
 		sysmon_channels[i].indexed = 1;

  reply	other threads:[~2022-02-09 19:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-09 19:45 [xilinx-xlnx:xlnx_rebase_v5.15 543/907] drivers/iio/adc/versal-sysmon.c:876:1-23: WARNING: Function "for_each_child_of_node" should have of_node_put() before return around line 879 kernel test robot
2022-02-09 19:37 ` kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-02-12 21:32 [xilinx-xlnx:xlnx_rebase_v5.15 543/923] " kernel test robot
2022-02-12 21:28 ` [PATCH] iio: versal-sysmon: fix for_each_child.cocci warnings kernel test robot
2022-02-12 22:39 Julia Lawall
2022-02-12 22:39 ` Julia Lawall
2022-02-12 22:39 ` Julia Lawall
2022-02-13 16:28 ` Jonathan Cameron
2022-02-13 16:28   ` Jonathan Cameron
2022-02-13 16:28   ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220209193728.GA83871@d9df6f5d589d \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.