public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ia64: Return -ENOMEM in ia64_mmap_check() error case
@ 2015-05-18 21:27 Joerg Roedel
  2015-06-02  9:09 ` Joerg Roedel
  0 siblings, 1 reply; 2+ messages in thread
From: Joerg Roedel @ 2015-05-18 21:27 UTC (permalink / raw)
  To: Tony Luck, Fenghua Yu; +Cc: linux-ia64, linux-kernel, Joerg Roedel

From: Joerg Roedel <jroedel@suse.de>

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.

Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
 arch/ia64/kernel/sys_ia64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/ia64/kernel/sys_ia64.c b/arch/ia64/kernel/sys_ia64.c
index 41e33f8..e927023 100644
--- a/arch/ia64/kernel/sys_ia64.c
+++ b/arch/ia64/kernel/sys_ia64.c
@@ -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;
 }
 
-- 
1.8.4.5


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

end of thread, other threads:[~2015-06-02  9:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-18 21:27 [PATCH] ia64: Return -ENOMEM in ia64_mmap_check() error case Joerg Roedel
2015-06-02  9:09 ` Joerg Roedel

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