Skip to content

Commit

Permalink
arm64: kexec_file: Fix sparse warning
Browse files Browse the repository at this point in the history
Sparse gets cross about us returning 0 from image_load(), which has a
return type of 'void *':

>> arch/arm64/kernel/kexec_image.c:130:16: sparse: sparse: Using plain integer as NULL pointer

Return NULL instead, as we don't use the return value for anything if it
does not indicate an error.

Cc: Benjamin Gwin <[email protected]>
Reported-by: kernel test robot <[email protected]>
Fixes: 108aa50 ("arm64: kexec_file: try more regions if loading segments fails")
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Will Deacon <[email protected]>
  • Loading branch information
willdeacon committed Nov 10, 2020
1 parent f969f03 commit 85f0b2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm64/kernel/kexec_image.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ static void *image_load(struct kimage *image,
kernel_segment->mem, kbuf.bufsz,
kernel_segment->memsz);

return 0;
return NULL;
}

#ifdef CONFIG_KEXEC_IMAGE_VERIFY_SIG
Expand Down

0 comments on commit 85f0b2f

Please sign in to comment.