Commit 77f6bf57ba9d2c50173536dbfdacdab27cb867ca

Authored by Andrew Morton
Committed by Jens Axboe
1 parent 4f23122858

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>

Showing 1 changed file with 3 additions and 1 deletions Side-by-side Diff

... ... @@ -595,8 +595,10 @@
595 595 }
596 596  
597 597 res = kernel_readv(in, vec, spd.nr_pages, *ppos);
598   - if (res < 0)
  598 + if (res < 0) {
  599 + error = res;
599 600 goto err;
  601 + }
600 602  
601 603 error = 0;
602 604 if (!res)