splice: fix error return code
[linux-2.6-block.git] / fs / splice.c
index c5e3c79b95a8af934a412fbe569ab26688c95c5a..41179c0a655bbf579e0a673b7d645fadbff9dbe4 100644 (file)
@@ -595,8 +595,10 @@ ssize_t default_file_splice_read(struct file *in, loff_t *ppos,
        }
 
        res = kernel_readv(in, vec, spd.nr_pages, *ppos);
-       if (res < 0)
+       if (res < 0) {
+               error = res;
                goto err;
+       }
 
        error = 0;
        if (!res)