LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] powerpc/kexec: fix for_each_child.cocci warning
@ 2021-08-03 14:59 Julia Lawall
  2021-08-18 13:38 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2021-08-03 14:59 UTC (permalink / raw)
  To: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras
  Cc: linux-kernel, kbuild-all, linuxppc-dev, linux-kernel, kbuild-all,
	Sumera Priyadarsini

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

for_each_node_by_type should have of_node_put() before return.

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>
---

The code seems to have been this way since the beginning of time.  Perhaps
the of_node_put is a no op for this code?

 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;
+			}
 		}
 	}


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

end of thread, other threads:[~2021-08-18 13:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-03 14:59 [PATCH] powerpc/kexec: fix for_each_child.cocci warning Julia Lawall
2021-08-18 13:38 ` Michael Ellerman

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).