Skip to content

Commit

Permalink
powerpc/crash: remove unnecessary NULL check before kvfree()
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
sourabhjains authored and mpe committed May 3, 2024
1 parent 849599b commit 9803af2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions arch/powerpc/kexec/crash.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,8 +484,7 @@ static void update_crash_elfcorehdr(struct kimage *image, struct memory_notify *
}
out:
kvfree(cmem);
if (elfbuf)
kvfree(elfbuf);
kvfree(elfbuf);
}

/**
Expand Down

0 comments on commit 9803af2

Please sign in to comment.