From: Sourabh Jain <sourabhjain@linux.ibm.com>
To: linuxppc-dev@ozlabs.org
Cc: kernel test robot <lkp@intel.com>,
Sourabh Jain <sourabhjain@linux.ibm.com>,
Stephen Rothwell <sfr@canb.auug.org.au>
Subject: [PATCH] powerpc/crash: remove unnecessary NULL check before kvfree()
Date: Thu, 2 May 2024 23:50:40 +0530 [thread overview]
Message-ID: <20240502182040.774759-1-sourabhjain@linux.ibm.com> (raw)
Fix the following coccicheck build warning:
arch/powerpc/kexec/crash.c:488:2-8: WARNING: NULL check before some
freeing functions is not needed.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202404261048.skfV5DDB-lkp@intel.com/
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
---
arch/powerpc/kexec/crash.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/powerpc/kexec/crash.c b/arch/powerpc/kexec/crash.c
index 21b193e938a3..9ac3266e4965 100644
--- a/arch/powerpc/kexec/crash.c
+++ b/arch/powerpc/kexec/crash.c
@@ -484,8 +484,7 @@ static void update_crash_elfcorehdr(struct kimage *image, struct memory_notify *
}
out:
kvfree(cmem);
- if (elfbuf)
- kvfree(elfbuf);
+ kvfree(elfbuf);
}
/**
--
2.44.0
next reply other threads:[~2024-05-02 18:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-02 18:20 Sourabh Jain [this message]
2024-05-07 14:41 ` [PATCH] powerpc/crash: remove unnecessary NULL check before kvfree() 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=20240502182040.774759-1-sourabhjain@linux.ibm.com \
--to=sourabhjain@linux.ibm.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=lkp@intel.com \
--cc=sfr@canb.auug.org.au \
/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 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 read-only IMAP folder(s) and NNTP newsgroup(s).