Commit 5f1664f9 authored by Dan Carpenter's avatar Dan Carpenter Committed by Linus Torvalds

splice: comparing unsigned int < 0

"ret" needs to be signed or the error handling for splice_to_pipe() won't
work correctly.
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Cc: Tom Zanussi <zanussi@comcast.net>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 0347af4e
...@@ -1215,14 +1215,14 @@ static void relay_page_release(struct splice_pipe_desc *spd, unsigned int i) ...@@ -1215,14 +1215,14 @@ static void relay_page_release(struct splice_pipe_desc *spd, unsigned int i)
/* /*
* subbuf_splice_actor - splice up to one subbuf's worth of data * subbuf_splice_actor - splice up to one subbuf's worth of data
*/ */
static int subbuf_splice_actor(struct file *in, static ssize_t subbuf_splice_actor(struct file *in,
loff_t *ppos, loff_t *ppos,
struct pipe_inode_info *pipe, struct pipe_inode_info *pipe,
size_t len, size_t len,
unsigned int flags, unsigned int flags,
int *nonpad_ret) int *nonpad_ret)
{ {
unsigned int pidx, poff, total_len, subbuf_pages, nr_pages, ret; unsigned int pidx, poff, total_len, subbuf_pages, nr_pages;
struct rchan_buf *rbuf = in->private_data; struct rchan_buf *rbuf = in->private_data;
unsigned int subbuf_size = rbuf->chan->subbuf_size; unsigned int subbuf_size = rbuf->chan->subbuf_size;
uint64_t pos = (uint64_t) *ppos; uint64_t pos = (uint64_t) *ppos;
...@@ -1241,6 +1241,7 @@ static int subbuf_splice_actor(struct file *in, ...@@ -1241,6 +1241,7 @@ static int subbuf_splice_actor(struct file *in,
.ops = &relay_pipe_buf_ops, .ops = &relay_pipe_buf_ops,
.spd_release = relay_page_release, .spd_release = relay_page_release,
}; };
ssize_t ret;
if (rbuf->subbufs_produced == rbuf->subbufs_consumed) if (rbuf->subbufs_produced == rbuf->subbufs_consumed)
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment