diff options
author | Mike Snitzer <snitzer@redhat.com> | 2010-10-09 12:12:13 +1030 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-28 21:51:23 -0700 |
commit | 39a1d13e238b714c8713fd9739141b552724d1fe (patch) | |
tree | 4a5100b71e2aa98a7b44ae6303485d90391f6ebc | |
parent | c4cb1dd93619b45e8d0295bbcb83389195ce66fb (diff) | |
download | lwn-39a1d13e238b714c8713fd9739141b552724d1fe.tar.gz lwn-39a1d13e238b714c8713fd9739141b552724d1fe.zip |
virtio-blk: fix request leak.
commit e4c4776dea9fd0295ebb3b215599d52938d6d7a3 upstream.
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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/block/virtio_blk.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 258bc2ae2885..3c108bc71e50 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -203,6 +203,7 @@ static int virtblk_get_id(struct gendisk *disk, char *id_str) struct virtio_blk *vblk = disk->private_data; struct request *req; struct bio *bio; + int err; bio = bio_map_kern(vblk->disk->queue, id_str, VIRTIO_BLK_ID_BYTES, GFP_KERNEL); @@ -216,7 +217,10 @@ static int virtblk_get_id(struct gendisk *disk, char *id_str) } req->cmd_type = REQ_TYPE_SPECIAL; - return blk_execute_rq(vblk->disk->queue, vblk->disk, req, false); + err = blk_execute_rq(vblk->disk->queue, vblk->disk, req, false); + blk_put_request(req); + + return err; } static int virtblk_ioctl(struct block_device *bdev, fmode_t mode, |