aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2009-05-14 03:49:44 -0400
committerJens Axboe <jens.axboe@oracle.com>2009-05-14 03:49:44 -0400
commit77f6bf57ba9d2c50173536dbfdacdab27cb867ca (patch)
tree09cfb70eb20081d7fc5af21039e3fda7f0b95f84
parent4f23122858a27ba97444b9b37a066d83edebd4c8 (diff)
splice: fix error return code
fs/splice.c: In function 'default_file_splice_read': fs/splice.c:566: warning: 'error' may be used uninitialized in this function which is sort-of true. The code will in fact return -ENOMEM instead of the kernel_readv() return value. Cc: Miklos Szeredi <miklos@szeredi.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r--fs/splice.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/splice.c b/fs/splice.c
index c5e3c79b95a8..41179c0a655b 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -595,8 +595,10 @@ ssize_t default_file_splice_read(struct file *in, loff_t *ppos,
595 } 595 }
596 596
597 res = kernel_readv(in, vec, spd.nr_pages, *ppos); 597 res = kernel_readv(in, vec, spd.nr_pages, *ppos);
598 if (res < 0) 598 if (res < 0) {
599 error = res;
599 goto err; 600 goto err;
601 }
600 602
601 error = 0; 603 error = 0;
602 if (!res) 604 if (!res)