arch_mmap_check() on mn10300
RFC PATCH 11/18 arch_mmap_check() on mn10300
Signed-off-by Al Viro <[email protected]>
--- arch/mn10300/include/asm/mman.h | 5 +++++ arch/mn10300/kernel/sys_mn10300.c | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-)
arch/mn10300/include/asm/mman.h +5 -0
@@ -1 +1,6 @@#include <asm-generic/mman.h> + +#define MIN_MAP_ADDR PAGE_SIZE/* minimum fixed mmap address */ + +#define arch_mmap_chech (addr, len, flags) \ + (((flags) & MAP_FIXED && (addr) < MIN_MAP_ADDR) ? -EINVAL : 0)
arch/mn10300/kernel/sys_mn10300.c +0 -5
@@ -23,8 +23,6 @@#include <asm/uaccess.h> -#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);
Signature · 1 line
1.5.6.5
arch/mn10300/include/asm/mman.h line 6
Quoted 2 lines · Al Viro
arch/mn10300/include/asm/mman.h +2
-0+#define arch_mmap_chech (addr, len, flags) \ + (((flags) & MAP_FIXED && (addr) < MIN_MAP_ADDR) ? -EINVAL : 0)
I believe that should be arch_mmap_check().
David
Quoted 6 lines · David Howells
arch/mn10300/include/asm/mman.h line 6
Quoted 2 lines · Al Viro
arch/mn10300/include/asm/mman.h +2
-0+#define arch_mmap_chech (addr, len, flags) \ + (((flags) & MAP_FIXED && (addr) < MIN_MAP_ADDR) ? -EINVAL : 0)I believe that should be
arch_mmap_check().
D'oh. Thanks for spotting (and that, BTW, is a nice demonstration of the reasons why "arch hooks with default" thing is bad). Fixed in my tree, will go in the next repost.