Skip to content

Commit

Permalink
splice: fix error return code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andrew Morton authored and Jens Axboe committed May 14, 2009
1 parent 4f23122 commit 77f6bf5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/splice.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 77f6bf5

Please sign in to comment.