diff options
author | Omar Sandoval <osandov@fb.com> | 2017-01-09 11:44:12 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-08-11 09:08:58 -0700 |
commit | 874f22658c5479a04427103ac5d59ecfb2ba890b (patch) | |
tree | 0a2b4855ce9c9b718b6f4c61e5a48e04d7374416 /lib/lru_cache.c | |
parent | c9e4ee445752ecd97c839ffa7e08146a614576dd (diff) |
virtio_blk: fix panic in initialization error path
[ Upstream commit 6bf6b0aa3da84a3d9126919a94c49c0fb7ee2fb3 ]
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 <osandov@fb.com>
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/lru_cache.c')
0 files changed, 0 insertions, 0 deletions