[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>

authored by

Zhang Yanmin and committed by
Tony Luck
d11cf326 fe12e25e

-7
-7
arch/ia64/kernel/sys_ia64.c
··· 182 182 } 183 183 } 184 184 185 - /* 186 - * A zero mmap always succeeds in Linux, independent of whether or not the 187 - * remaining arguments are valid. 188 - */ 189 - if (len == 0) 190 - goto out; 191 - 192 185 /* Careful about overflows.. */ 193 186 len = PAGE_ALIGN(len); 194 187 if (!len || len > TASK_SIZE) {