Skip to content

Commit

Permalink
loop: don't increment p->offset with (size_t) -EINVAL
Browse files Browse the repository at this point in the history
Upon a 'transfer error block' size is set to -EINVAL, but this becomes positive
since size is unsigned: p->offset still gets incremented.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
  • Loading branch information
Roel Kluin authored and Jens Axboe committed Mar 5, 2009
1 parent 5e18cfd commit a3941ec
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/block/loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,7 @@ lo_splice_actor(struct pipe_inode_info *pipe, struct pipe_buffer *buf,
struct loop_device *lo = p->lo;
struct page *page = buf->page;
sector_t IV;
size_t size;
int ret;
int size, ret;

ret = buf->ops->confirm(pipe, buf);
if (unlikely(ret))
Expand Down

0 comments on commit a3941ec

Please sign in to comment.