summaryrefslogtreecommitdiffstats
path: root/arch/ia64/kernel/sys_ia64.c
diff options
context:
space:
mode:
authorZhang Yanmin2005-05-23 02:47:00 +0200
committerTony Luck2005-05-26 19:19:07 +0200
commitd11cf326bd5e785cc5a3f5a3d3f4e3a5522f4fb7 (patch)
tree56912a4b84f6db3aa1d615a4174b2c2845fe870e /arch/ia64/kernel/sys_ia64.c
parent[IA64] initialize spinlock pfm_alt_install_check (diff)
downloadkernel-qcow2-linux-d11cf326bd5e785cc5a3f5a3d3f4e3a5522f4fb7.tar.gz
kernel-qcow2-linux-d11cf326bd5e785cc5a3f5a3d3f4e3a5522f4fb7.tar.xz
kernel-qcow2-linux-d11cf326bd5e785cc5a3f5a3d3f4e3a5522f4fb7.zip
[IA64] sys_mmap doesn't follow posix.1 when parameter len=0
In IA64 kernel, sys_mmap calls do_mmap2 and do_mmap2 returns addr if len=0, which means the mmap sys call succeeds. Posix.1 says: The mmap() function shall fail if: [EINVAL] The value of len is zero. Here is a patch to fix it. Signed-off-by: Zhang Yanmin <yanmin.zhang@intel.com> Acked-by: David Mosberger <davidm@hpl.hp.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/kernel/sys_ia64.c')
-rw-r--r--arch/ia64/kernel/sys_ia64.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/arch/ia64/kernel/sys_ia64.c b/arch/ia64/kernel/sys_ia64.c
index a8cf6d8a509c..770fab37928e 100644
--- a/arch/ia64/kernel/sys_ia64.c
+++ b/arch/ia64/kernel/sys_ia64.c
@@ -182,13 +182,6 @@ do_mmap2 (unsigned long addr, unsigned long len, int prot, int flags, int fd, un
}
}
- /*
- * A zero mmap always succeeds in Linux, independent of whether or not the
- * remaining arguments are valid.
- */
- if (len == 0)
- goto out;
-
/* Careful about overflows.. */
len = PAGE_ALIGN(len);
if (!len || len > TASK_SIZE) {