[PATCH for v4.9 LTS 80/87] virtio_blk: fix panic in initialization error path

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Omar Sandoval [ 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

[PATCH for v4.9 LTS 80/87] virtio_blk: fix panic in initialization error path

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Omar Sandoval [ 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