aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSourabh Jain <[email protected]>2024-05-02 23:50:40 +0530
committerMichael Ellerman <[email protected]>2024-05-03 12:20:50 +1000
commit9803af291162dbca4b9773586a3f5c392f0dd974 (patch)
tree135fc0dd20d91382cbd6451582fe100a944ced7c
parent849599b702ef8977fcd5b2f27c61ef773c42bb88 (diff)
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 <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Sourabh Jain <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://msgid.link/[email protected]
-rw-r--r--arch/powerpc/kexec/crash.c3
1 files changed, 1 insertions, 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);
}
/**