patch-2.1.5 linux/mm/filemap.c

Next file: linux/net/ipv4/af_inet.c
Previous file: linux/include/asm-i386/vm86.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.4/linux/mm/filemap.c linux/mm/filemap.c
@@ -573,8 +573,10 @@
 	unsigned long pos, ppos, page_cache;
 	int reada_ok;
 
-	if (!access_ok(VERIFY_WRITE, buf,count))
+	if (!access_ok(VERIFY_WRITE, buf, count))
 		return -EFAULT;
+	if (!count)
+		return 0;
 	error = 0;
 	read = 0;
 	page_cache = 0;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov