block: Always check length of all iov entries in blk_rq_map_user_iov()

Even after commit 5478755616
("block: check for proper length of iov entries earlier ...")
we still won't check for zero-length entries after an unaligned
entry.  Remove the break-statement, so all entries are checked.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: stable@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Ben Hutchings 2011-11-13 19:58:09 +01:00 committed by Jens Axboe
parent 1937335856
commit 6b76106d8e
1 changed files with 4 additions and 3 deletions

View File

@ -204,10 +204,11 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
if (!iov[i].iov_len)
return -EINVAL;
if (uaddr & queue_dma_alignment(q)) {
/*
* Keep going so we check length of all segments
*/
if (uaddr & queue_dma_alignment(q))
unaligned = 1;
break;
}
}
if (unaligned || (q->dma_pad_mask & len) || map_data)