]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/read_write.c
[PATCH] undo do_readv_writev() behavior change
[linux-2.6-omap-h63xx.git] / fs / read_write.c
index 6be4b1a1956b21004c2b03382f6f4b08ecc957d3..c4c2bee373eddeab7b0d3bb9e110453a63ccd436 100644 (file)
@@ -467,10 +467,10 @@ static ssize_t do_readv_writev(int type, struct file *file,
                void __user *buf = iov[seg].iov_base;
                ssize_t len = (ssize_t)iov[seg].iov_len;
 
-               if (unlikely(!access_ok(vrfy_dir(type), buf, len)))
-                       goto Efault;
                if (len < 0)    /* size_t not fitting an ssize_t .. */
                        goto out;
+               if (unlikely(!access_ok(vrfy_dir(type), buf, len)))
+                       goto Efault;
                tot_len += len;
                if ((ssize_t)tot_len < 0) /* maths overflow on the ssize_t */
                        goto out;