From: Sourabh Jain Date: Thu, 2 May 2024 18:20:40 +0000 (+0530) Subject: powerpc/crash: remove unnecessary NULL check before kvfree() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=9803af291162dbca4b9773586a3f5c392f0dd974;p=linux.git powerpc/crash: remove unnecessary NULL check before kvfree() 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 Closes: https://lore.kernel.org/oe-kbuild-all/202404261048.skfV5DDB-lkp@intel.com/ Signed-off-by: Sourabh Jain Signed-off-by: Michael Ellerman Link: https://msgid.link/20240502182040.774759-1-sourabhjain@linux.ibm.com --- diff --git a/arch/powerpc/kexec/crash.c b/arch/powerpc/kexec/crash.c index 21b193e938a37..9ac3266e49652 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); } /**