diff options
author | Bo Liu <liubo03@inspur.com> | 2022-11-15 04:17:57 +0100 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2022-11-18 00:05:21 +0100 |
commit | dc64cc12bcd14219afb91b55d23192c3eb45aa43 (patch) | |
tree | 169277df2bcc79fe6eb79dd9d555d951f1b84fd4 /fs/binfmt_elf.c | |
parent | binfmt_elf: simplify error handling in load_elf_phdrs() (diff) | |
download | linux-dc64cc12bcd14219afb91b55d23192c3eb45aa43.tar.xz linux-dc64cc12bcd14219afb91b55d23192c3eb45aa43.zip |
binfmt_elf: replace IS_ERR() with IS_ERR_VALUE()
Avoid typecasts that are needed for IS_ERR() and use IS_ERR_VALUE()
instead.
Signed-off-by: Bo Liu <liubo03@inspur.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20221115031757.2426-1-liubo03@inspur.com
Diffstat (limited to 'fs/binfmt_elf.c')
-rw-r--r-- | fs/binfmt_elf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 528e2ac8931f..d9af34f816a9 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -1160,7 +1160,7 @@ out_free_interp: error = elf_map(bprm->file, load_bias + vaddr, elf_ppnt, elf_prot, elf_flags, total_size); if (BAD_ADDR(error)) { - retval = IS_ERR((void *)error) ? + retval = IS_ERR_VALUE(error) ? PTR_ERR((void*)error) : -EINVAL; goto out_free_dentry; } @@ -1245,7 +1245,7 @@ out_free_interp: interpreter, load_bias, interp_elf_phdata, &arch_state); - if (!IS_ERR((void *)elf_entry)) { + if (!IS_ERR_VALUE(elf_entry)) { /* * load_elf_interp() returns relocation * adjustment @@ -1254,7 +1254,7 @@ out_free_interp: elf_entry += interp_elf_ex->e_entry; } if (BAD_ADDR(elf_entry)) { - retval = IS_ERR((void *)elf_entry) ? + retval = IS_ERR_VALUE(elf_entry) ? (int)elf_entry : -EINVAL; goto out_free_dentry; } |