diff options
Diffstat (limited to 'block/blk-map.c')
-rw-r--r-- | block/blk-map.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/block/blk-map.c b/block/blk-map.c index 0173a72a8aa9..0acb6640ead7 100644 --- a/block/blk-map.c +++ b/block/blk-map.c @@ -120,6 +120,9 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq, struct iov_iter i; int ret; + if (!iter_is_iovec(iter)) + goto fail; + if (map_data) copy = true; else if (iov_iter_alignment(iter) & align) @@ -142,6 +145,7 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq, unmap_rq: __blk_rq_unmap_user(bio); +fail: rq->bio = NULL; return -EINVAL; } |