X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=block%2Fblk-map.c;h=2990447f45e913f7aa968ddc3979ea7b1a027a80;hb=6ff232070a1088807e24f657b5d6f299f1ec32f6;hp=4849fa36161eb697b47b08efa27af085b58bed3c;hpb=c493756e2a8a78bcaae30668317890dcfe86e7c3;p=linux-2.6-omap-h63xx.git diff --git a/block/blk-map.c b/block/blk-map.c index 4849fa36161..2990447f45e 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, return PTR_ERR(bio); if (bio->bi_size != len) { + /* + * Grab an extra reference to this bio, as bio_unmap_user() + * expects to be able to drop it twice as it happens on the + * normal IO completion path + */ + bio_get(bio); bio_endio(bio, 0); - bio_unmap_user(bio); + __blk_rq_unmap_user(bio); return -EINVAL; }