LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@inria.fr>
To: Michael Ellerman <mpe@ellerman.id.au>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>
Cc: linux-kernel@vger.kernel.org, kbuild-all@lists.01.org,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	kbuild-all@lists.01.org,
	Sumera Priyadarsini <sylphrenadin@gmail.com>
Subject: [PATCH] powerpc/kexec: fix for_each_child.cocci warning
Date: Tue, 3 Aug 2021 16:59:55 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2108031654080.17639@hadrien> (raw)

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


             reply	other threads:[~2021-08-03 15:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-03 14:59 Julia Lawall [this message]
2021-08-18 13:38 ` Michael Ellerman

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=alpine.DEB.2.22.394.2108031654080.17639@hadrien \
    --to=julia.lawall@inria.fr \
    --cc=benh@kernel.crashing.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    --cc=sylphrenadin@gmail.com \
    --subject='Re: [PATCH] powerpc/kexec: fix for_each_child.cocci warning' \
    /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

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