From e650bfc302132ad0b016b4af92db1d304a67d34b Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sat, 20 Mar 2004 16:38:39 -0800 Subject: [PATCH] [PATCH] mprotect return value fix From: Marc-Christian Petersen 2.4 patch from Adrian Bunk. ERRORS The mprotect() function shall fail if: ... [ENOMEM] Addresses in the range [addr,addr+len) are invalid for the address space of a process, or specify one or more pages which are not mapped. --- mm/mprotect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/mprotect.c b/mm/mprotect.c index 31b27771a74c6..24b3d13b51ec3 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c @@ -237,7 +237,7 @@ sys_mprotect(unsigned long start, size_t len, unsigned long prot) len = PAGE_ALIGN(len); end = start + len; if (end < start) - return -EINVAL; + return -ENOMEM; if (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC | PROT_SEM)) return -EINVAL; if (end == start) -- 2.53.0