Skip to content

Commit dc64cc1

Browse files
Bo Liukees
authored andcommitted
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 <[email protected]> Signed-off-by: Kees Cook <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent ef20c51 commit dc64cc1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fs/binfmt_elf.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,7 +1160,7 @@ static int load_elf_binary(struct linux_binprm *bprm)
11601160
error = elf_map(bprm->file, load_bias + vaddr, elf_ppnt,
11611161
elf_prot, elf_flags, total_size);
11621162
if (BAD_ADDR(error)) {
1163-
retval = IS_ERR((void *)error) ?
1163+
retval = IS_ERR_VALUE(error) ?
11641164
PTR_ERR((void*)error) : -EINVAL;
11651165
goto out_free_dentry;
11661166
}
@@ -1245,7 +1245,7 @@ static int load_elf_binary(struct linux_binprm *bprm)
12451245
interpreter,
12461246
load_bias, interp_elf_phdata,
12471247
&arch_state);
1248-
if (!IS_ERR((void *)elf_entry)) {
1248+
if (!IS_ERR_VALUE(elf_entry)) {
12491249
/*
12501250
* load_elf_interp() returns relocation
12511251
* adjustment
@@ -1254,7 +1254,7 @@ static int load_elf_binary(struct linux_binprm *bprm)
12541254
elf_entry += interp_elf_ex->e_entry;
12551255
}
12561256
if (BAD_ADDR(elf_entry)) {
1257-
retval = IS_ERR((void *)elf_entry) ?
1257+
retval = IS_ERR_VALUE(elf_entry) ?
12581258
(int)elf_entry : -EINVAL;
12591259
goto out_free_dentry;
12601260
}

0 commit comments

Comments
 (0)