public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] elf: simpler check for -EEXIST
@ 2019-03-14 20:42 Alexey Dobriyan
  2019-03-14 22:02 ` Tetsuo Handa
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Dobriyan @ 2019-03-14 20:42 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, penguin-kernel

	PTR_ERR((void *)map_addr) == -EEXIST

is a very complicated way of doing the obvious.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 fs/binfmt_elf.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -375,8 +375,7 @@ static unsigned long elf_map(struct file *filep, unsigned long addr,
 	} else
 		map_addr = vm_mmap(filep, addr, size, prot, type, off);
 
-	if ((type & MAP_FIXED_NOREPLACE) &&
-	    PTR_ERR((void *)map_addr) == -EEXIST)
+	if ((type & MAP_FIXED_NOREPLACE) && map_addr == -EEXIST)
 		pr_info("%d (%s): Uhuuh, elf segment at %px requested but the memory is mapped already\n",
 			task_pid_nr(current), current->comm, (void *)addr);
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-03-16  8:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-14 20:42 [PATCH 1/2] elf: simpler check for -EEXIST Alexey Dobriyan
2019-03-14 22:02 ` Tetsuo Handa
2019-03-15 16:05   ` Alexey Dobriyan
2019-03-16  8:31     ` Michal Hocko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox