All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [PATCH] coccinelle: iterators: fix for_each_child.cocci warnings
Date: Tue, 03 Aug 2021 17:43:46 +0800	[thread overview]
Message-ID: <20210803094346.GA44901@34bff7c39a32> (raw)
In-Reply-To: <202108031732.QDAsXm3N-lkp@intel.com>

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Sumera Priyadarsini <sylphrenadin@gmail.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Michael Ellerman <mpe@ellerman.id.au>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: linuxppc-dev(a)lists.ozlabs.org
CC: linux-kernel(a)vger.kernel.org

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

arch/powerpc/kexec/core_64.c:54:1-22: WARNING: Function "for_each_node_by_type" should have of_node_put() before return around line 68.


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: Sumera Priyadarsini <sylphrenadin@gmail.com>
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:   c500bee1c5b2f1d59b1081ac879d73268ab0ff17
commit: 82c2d81361ecd142a54e84a9da1e287113314a4f coccinelle: iterators: Add for_each_child.cocci script
:::::: branch date: 34 hours ago
:::::: commit date: 10 months ago

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

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

--- a/arch/powerpc/kexec/core_64.c
+++ b/arch/powerpc/kexec/core_64.c
@@ -64,8 +64,10 @@ int default_machine_kexec_prepare(struct
 			begin = image->segment[i].mem;
 			end = begin + image->segment[i].memsz;
 
-			if ((begin < high) && (end > low))
+			if ((begin < high) && (end > low)) {
+				of_node_put(node);
 				return -ETXTBSY;
+			}
 		}
 	}
 

  reply	other threads:[~2021-08-03  9:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-03  9:43 arch/powerpc/kexec/core_64.c:54:1-22: WARNING: Function "for_each_node_by_type" should have of_node_put() before return around line 68 kernel test robot
2021-08-03  9:43 ` kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-06-23 14:01 drivers/phy/rockchip/phy-rockchip-inno-usb2.c:1149:1-33: WARNING: Function "for_each_available_child_of_node" should have of_node_put() before break around line 1184 kernel test robot
2021-06-23 14:02 ` [PATCH] coccinelle: iterators: fix for_each_child.cocci warnings kernel test robot
2021-03-27 14:34 sound/soc/bcm/cygnus-ssp.c:1346:1-33: WARNING: Function "for_each_available_child_of_node" should have of_node_put() before return around line 1352 kernel test robot
2021-03-27 14:34 ` [PATCH] coccinelle: iterators: fix for_each_child.cocci warnings kernel test robot
2021-03-21  7:14 drivers/of/overlay.c:788:1-23: WARNING: Function "for_each_child_of_node" should have of_node_put() before goto around lines 799 kernel test robot
2021-03-21  7:14 ` [PATCH] coccinelle: iterators: fix for_each_child.cocci warnings kernel test robot
2021-01-20 14:17 drivers/usb/gadget/udc/aspeed-vhub/hub.c:982:1-23: WARNING: Function "for_each_child_of_node" should have of_node_put() before break around line 1003 kernel test robot
2021-01-20 14:17 ` [PATCH] coccinelle: iterators: fix for_each_child.cocci warnings kernel test robot
2020-11-22 20:01 net/dsa/dsa2.c:738:1-33: WARNING: Function "for_each_available_child_of_node" should have of_node_put() before goto around lines 741 kernel test robot
2020-11-22 20:01 ` [PATCH] coccinelle: iterators: fix for_each_child.cocci warnings kernel test robot

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=20210803094346.GA44901@34bff7c39a32 \
    --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.