ia64: Return -ENOMEM in ia64_mmap_check() error case
PATCH 1/1 ia64: Return -ENOMEM in ia64_mmap_check() error case
From: Joerg Roedel <[email protected]>
The value -ENOMEM is the expected return code for mmap when the address range verification failes on a MAP_FIXED request, as stated in the specification:
[ENOMEM]
MAP_FIXED was specified, and the range [addr,addr+len) exceeds that allowed for the address space of a process;
The ia64_mmap_check() function is part of that verification and should return -ENOMEM too.
--- arch/ia64/kernel/sys_ia64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/ia64/kernel/sys_ia64.c +1 -1
@@ -124,7 +124,7 @@ int ia64_mmap_check(unsigned long addr, unsigned long len,*/ roff =REGION_OFFSET (addr);if ((len >RGN_MAP_LIMIT ) || (roff > (RGN_MAP_LIMIT - len))) -return -EINVAL ; +return -ENOMEM ;return 0 ; }
Signature · 1 line
1.8.4.5
Ping. Tony, Fenghua, any opinion on this?
Quoted 34 lines · Joerg Roedel
From: Joerg Roedel <[email protected]>
The value
-ENOMEMis the expected return code for mmap when the address range verification failes on aMAP_FIXEDrequest, as stated in the specification:[ENOMEM]
MAP_FIXEDwas specified, and the range [addr,addr+len) exceeds that allowed for the address space of a process;The
ia64_mmap_check()function is part of that verification and should return-ENOMEMtoo.Signed-off-by Joerg Roedel <[email protected]>--- arch/ia64/kernel/sys_ia64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/ia64/kernel/sys_ia64.c +1
-1@@ -124,7 +124,7 @@ int ia64_mmap_check(unsigned long addr, unsigned long len,*/ roff =REGION_OFFSET (addr);if ((len >RGN_MAP_LIMIT ) || (roff > (RGN_MAP_LIMIT - len))) -return -EINVAL ; +return -ENOMEM ;return 0 ; }Signature · 1 line
1.8.4.5