]> Git Repo - linux.git/commit
virtio_blk: fix panic in initialization error path
authorOmar Sandoval <[email protected]>
Mon, 9 Jan 2017 19:44:12 +0000 (11:44 -0800)
committerJens Axboe <[email protected]>
Tue, 10 Jan 2017 20:30:50 +0000 (13:30 -0700)
commit6bf6b0aa3da84a3d9126919a94c49c0fb7ee2fb3
tree4f7b1d400af13e0b087ee14116b5a56d840d1c2a
parent25b4acfc7de0fc4da3bfea3a316f7282c6fbde81
virtio_blk: fix panic in initialization error path

If blk_mq_init_queue() returns an error, it gets assigned to
vblk->disk->queue. Then, when we call put_disk(), we end up calling
blk_put_queue() with the ERR_PTR, causing a bad dereference. Fix it by
only assigning to vblk->disk->queue on success.

Signed-off-by: Omar Sandoval <[email protected]>
Reviewed-by: Jeff Moyer <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
drivers/block/virtio_blk.c
This page took 0.07058 seconds and 4 git commands to generate.