OSDN Git Service

fs, elf: don't complain MAP_FIXED_NOREPLACE unless -EEXIST error
[uclinux-h8/linux.git] / fs / binfmt_elf.c
index 41e0418..4ad6f66 100644 (file)
@@ -377,10 +377,10 @@ 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) && BAD_ADDR(map_addr))
-               pr_info("%d (%s): Uhuuh, elf segment at %p requested but the memory is mapped already\n",
-                               task_pid_nr(current), current->comm,
-                               (void *)addr);
+       if ((type & MAP_FIXED_NOREPLACE) &&
+           PTR_ERR((void *)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);
 
        return(map_addr);
 }