* [PATCH] powerpc/crash: remove unnecessary NULL check before kvfree()
@ 2024-05-02 18:20 Sourabh Jain
2024-05-07 14:41 ` Michael Ellerman
0 siblings, 1 reply; 2+ messages in thread
From: Sourabh Jain @ 2024-05-02 18:20 UTC (permalink / raw)
To: linuxppc-dev; +Cc: kernel test robot, Sourabh Jain, Stephen Rothwell
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] powerpc/crash: remove unnecessary NULL check before kvfree()
2024-05-02 18:20 [PATCH] powerpc/crash: remove unnecessary NULL check before kvfree() Sourabh Jain
@ 2024-05-07 14:41 ` Michael Ellerman
0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2024-05-07 14:41 UTC (permalink / raw)
To: linuxppc-dev, Sourabh Jain; +Cc: Stephen Rothwell, kernel test robot
On Thu, 02 May 2024 23:50:40 +0530, Sourabh Jain wrote:
> Fix the following coccicheck build warning:
>
> arch/powerpc/kexec/crash.c:488:2-8: WARNING: NULL check before some
> freeing functions is not needed.
>
>
Applied to powerpc/topic/kdump-hotplug.
[1/1] powerpc/crash: remove unnecessary NULL check before kvfree()
https://git.kernel.org/powerpc/c/9803af291162dbca4b9773586a3f5c392f0dd974
cheers
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-05-07 14:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-02 18:20 [PATCH] powerpc/crash: remove unnecessary NULL check before kvfree() Sourabh Jain
2024-05-07 14:41 ` 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).