patch-2.4.21 linux-2.4.21/mm/mmap.c
Next file: linux-2.4.21/mm/shmem.c
Previous file: linux-2.4.21/mm/highmem.c
Back to the patch index
Back to the overall index
- Lines: 24
- Date:
2003-06-13 07:51:39.000000000 -0700
- Orig file:
linux-2.4.20/mm/mmap.c
- Orig date:
2002-11-28 15:53:15.000000000 -0800
diff -urN linux-2.4.20/mm/mmap.c linux-2.4.21/mm/mmap.c
@@ -403,10 +403,12 @@
if (file && (!file->f_op || !file->f_op->mmap))
return -ENODEV;
- if ((len = PAGE_ALIGN(len)) == 0)
+ if (!len)
return addr;
- if (len > TASK_SIZE)
+ len = PAGE_ALIGN(len);
+
+ if (len > TASK_SIZE || len == 0)
return -EINVAL;
/* offset overflow? */
@@ -900,6 +902,8 @@
break;
}
no_mmaps:
+ if (last < first)
+ return;
/*
* If the PGD bits are not consecutive in the virtual address, the
* old method of shifting the VA >> by PGDIR_SHIFT doesn't work.
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)