aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@redhat.com>2010-10-08 21:42:13 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-09 14:42:37 -0400
commite4c4776dea9fd0295ebb3b215599d52938d6d7a3 (patch)
tree4899150e0268f447898a5180ecf43d0783afc9ee
parent6b0cd00bc396daf5c2dcf17a8d82055335341f46 (diff)
virtio-blk: fix request leak.
Must drop reference taken by blk_make_request(). Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Cc: stable@kernel.org # .35.x Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/block/virtio_blk.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 2aafafca2b13..1101e251a629 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -202,6 +202,7 @@ static int virtblk_get_id(struct gendisk *disk, char *id_str)
202 struct virtio_blk *vblk = disk->private_data; 202 struct virtio_blk *vblk = disk->private_data;
203 struct request *req; 203 struct request *req;
204 struct bio *bio; 204 struct bio *bio;
205 int err;
205 206
206 bio = bio_map_kern(vblk->disk->queue, id_str, VIRTIO_BLK_ID_BYTES, 207 bio = bio_map_kern(vblk->disk->queue, id_str, VIRTIO_BLK_ID_BYTES,
207 GFP_KERNEL); 208 GFP_KERNEL);
@@ -215,7 +216,10 @@ static int virtblk_get_id(struct gendisk *disk, char *id_str)
215 } 216 }
216 217
217 req->cmd_type = REQ_TYPE_SPECIAL; 218 req->cmd_type = REQ_TYPE_SPECIAL;
218 return blk_execute_rq(vblk->disk->queue, vblk->disk, req, false); 219 err = blk_execute_rq(vblk->disk->queue, vblk->disk, req, false);
220 blk_put_request(req);
221
222 return err;
219} 223}
220 224
221static int virtblk_locked_ioctl(struct block_device *bdev, fmode_t mode, 225static int virtblk_locked_ioctl(struct block_device *bdev, fmode_t mode,