diff options
Diffstat (limited to 'block/blk-map.c')
-rw-r--r-- | block/blk-map.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/block/blk-map.c b/block/blk-map.c index 4849fa36161e..2990447f45e9 100644 --- a/block/blk-map.c +++ b/block/blk-map.c | |||
@@ -217,8 +217,14 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq, | |||
217 | return PTR_ERR(bio); | 217 | return PTR_ERR(bio); |
218 | 218 | ||
219 | if (bio->bi_size != len) { | 219 | if (bio->bi_size != len) { |
220 | /* | ||
221 | * Grab an extra reference to this bio, as bio_unmap_user() | ||
222 | * expects to be able to drop it twice as it happens on the | ||
223 | * normal IO completion path | ||
224 | */ | ||
225 | bio_get(bio); | ||
220 | bio_endio(bio, 0); | 226 | bio_endio(bio, 0); |
221 | bio_unmap_user(bio); | 227 | __blk_rq_unmap_user(bio); |
222 | return -EINVAL; | 228 | return -EINVAL; |
223 | } | 229 | } |
224 | 230 | ||