binfmt_elf: simplify error handling in load_elf_phdrs()
authorRolf Eike Beer <eb@emlix.com>
Wed, 19 Oct 2022 07:52:16 +0000 (09:52 +0200)
committerKees Cook <keescook@chromium.org>
Tue, 25 Oct 2022 22:19:52 +0000 (15:19 -0700)
commitef20c5139c3157b5c6eda46f496952bddffe9ad6
tree5e5db511c06280e4369980f55b2fc4c92336fd56
parentcfc46ca4fdcaef6f0215f56d89162400aee402e3
binfmt_elf: simplify error handling in load_elf_phdrs()

The err variable was the same like retval, but capped to <= 0. This is the
same as retval as elf_read() never returns positive values.

Signed-off-by: Rolf Eike Beer <eb@emlix.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/4137126.7Qn9TF0dmF@mobilepool36.emlix.com
fs/binfmt_elf.c