From 564b3bffc619dcbdd160de597b0547a7017ea010 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 30 Nov 2009 17:00:51 -0500 Subject: [PATCH] arch_mmap_check() on mn10300 Signed-off-by: Al Viro --- arch/mn10300/include/asm/mman.h | 5 +++++ arch/mn10300/kernel/sys_mn10300.c | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/mn10300/include/asm/mman.h b/arch/mn10300/include/asm/mman.h index 8eebf89f5ab1..db5c53da73ce 100644 --- a/arch/mn10300/include/asm/mman.h +++ b/arch/mn10300/include/asm/mman.h @@ -1 +1,6 @@ #include + +#define MIN_MAP_ADDR PAGE_SIZE /* minimum fixed mmap address */ + +#define arch_mmap_check(addr, len, flags) \ + (((flags) & MAP_FIXED && (addr) < MIN_MAP_ADDR) ? -EINVAL : 0) diff --git a/arch/mn10300/kernel/sys_mn10300.c b/arch/mn10300/kernel/sys_mn10300.c index 8ca5af00334c..ec4100dfcb7d 100644 --- a/arch/mn10300/kernel/sys_mn10300.c +++ b/arch/mn10300/kernel/sys_mn10300.c @@ -23,8 +23,6 @@ #include -#define MIN_MAP_ADDR PAGE_SIZE /* minimum fixed mmap address */ - /* * memory mapping syscall */ @@ -37,9 +35,6 @@ asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); - if (flags & MAP_FIXED && addr < MIN_MAP_ADDR) - goto out; - error = -EBADF; if (!(flags & MAP_ANONYMOUS)) { file = fget(fd); -- 2.20.1