lkml.org 
[lkml]   [2010]   [Oct]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[045/103] virtio-blk: fix request leak.
2.6.35-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Mike Snitzer <snitzer@redhat.com>

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>

---
drivers/block/virtio_blk.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -203,6 +203,7 @@ static int virtblk_get_id(struct gendisk
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
}

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,



\
 
 \ /
  Last update: 2010-10-22 21:15    [W:0.272 / U:5.724 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site