We were checking for iter to be NULL after dereferencing it. Lets first check it and then use it. Signed-off-by: Sudip Mukherjee <sudip.mukherjee@xxxxxxxxxxxxxxx> --- block/blk-map.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/blk-map.c b/block/blk-map.c index a54f054..089ed59 100644 --- a/block/blk-map.c +++ b/block/blk-map.c @@ -126,7 +126,7 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq, const struct iov_iter *iter, gfp_t gfp_mask) { struct iovec iov, prv = {.iov_base = NULL, .iov_len = 0}; - bool copy = (q->dma_pad_mask & iter->count) || map_data; + bool copy; struct bio *bio = NULL; struct iov_iter i; int ret; @@ -134,6 +134,7 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq, if (!iter || !iter->count) return -EINVAL; + copy = (q->dma_pad_mask & iter->count) || map_data; iov_for_each(iov, i, *iter) { unsigned long uaddr = (unsigned long) iov.iov_base; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html