diff --git a/block/blk-map.c b/block/blk-map.c index 8584babf3ea0..6c6f0ef1407b 100644 --- a/block/blk-map.c +++ b/block/blk-map.c @@ -344,7 +344,8 @@ static int bio_map_user_iov(struct request *rq, struct iov_iter *iter, return 0; out_unmap: - bio_release_pages(bio, false); + if (bio->bi_vcnt) + bio_release_pages(bio, false); blk_mq_map_bio_put(bio); return ret; }