Skip to content

Commit 9803af2

Browse files
sourabhjainsmpe
authored andcommitted
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 <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202404261048.skfV5DDB-lkp@intel.com/ Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20240502182040.774759-1-sourabhjain@linux.ibm.com
1 parent 849599b commit 9803af2

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

arch/powerpc/kexec/crash.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,7 @@ static void update_crash_elfcorehdr(struct kimage *image, struct memory_notify *
484484
}
485485
out:
486486
kvfree(cmem);
487-
if (elfbuf)
488-
kvfree(elfbuf);
487+
kvfree(elfbuf);
489488
}
490489

491490
/**

0 commit comments

Comments
 (0)