Commit e4c4776d authored by Mike Snitzer's avatar Mike Snitzer Committed by Linus Torvalds

virtio-blk: fix request leak.

Must drop reference taken by blk_make_request().
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
Cc: stable@kernel.org # .35.x
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 6b0cd00b
...@@ -202,6 +202,7 @@ static int virtblk_get_id(struct gendisk *disk, char *id_str) ...@@ -202,6 +202,7 @@ static int virtblk_get_id(struct gendisk *disk, char *id_str)
struct virtio_blk *vblk = disk->private_data; struct virtio_blk *vblk = disk->private_data;
struct request *req; struct request *req;
struct bio *bio; struct bio *bio;
int err;
bio = bio_map_kern(vblk->disk->queue, id_str, VIRTIO_BLK_ID_BYTES, bio = bio_map_kern(vblk->disk->queue, id_str, VIRTIO_BLK_ID_BYTES,
GFP_KERNEL); GFP_KERNEL);
...@@ -215,7 +216,10 @@ static int virtblk_get_id(struct gendisk *disk, char *id_str) ...@@ -215,7 +216,10 @@ static int virtblk_get_id(struct gendisk *disk, char *id_str)
} }
req->cmd_type = REQ_TYPE_SPECIAL; 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_locked_ioctl(struct block_device *bdev, fmode_t mode, static int virtblk_locked_ioctl(struct block_device *bdev, fmode_t mode,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment