From: Roel Kluin Date: Thu, 5 Mar 2009 07:03:53 +0000 (+0100) Subject: loop: don't increment p->offset with (size_t) -EINVAL X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a3941ec101a5ec54c1e929730afeb196441a171e;p=linux-beck.git loop: don't increment p->offset with (size_t) -EINVAL 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 Signed-off-by: Jens Axboe --- diff --git a/drivers/block/loop.c b/drivers/block/loop.c index edbaac6c0573..bf0345577672 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -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))