Skip to content

Commit

Permalink
block: Always check length of all iov entries in blk_rq_map_user_iov()
Browse files Browse the repository at this point in the history
Even after commit 5478755
("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 <[email protected]>
Cc: [email protected]
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
bwhacks authored and axboe committed Nov 13, 2011
1 parent 1937335 commit 6b76106
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions block/blk-map.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6b76106

Please sign in to comment.