Skip to content

Commit 6213442

Browse files
author
Mamatha Inamdar
committed
powerpc/crash: remove unnecessary NULL check before kvfree()
JIRA: https://issues.redhat.com/browse/RHEL-101851 commit 9803af2 Author: Sourabh Jain <sourabhjain@linux.ibm.com> Date: Thu May 2 23:50:40 2024 +0530 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 Signed-off-by: Mamatha Inamdar <minamdar@redhat.com>
1 parent fcbcd45 commit 6213442

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

arch/powerpc/kexec/crash.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,7 @@ static void update_crash_elfcorehdr(struct kimage *image, struct memory_notify *
468468
}
469469
out:
470470
kvfree(cmem);
471-
if (elfbuf)
472-
kvfree(elfbuf);
471+
kvfree(elfbuf);
473472
}
474473

475474
/**

0 commit comments

Comments
 (0)