summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2017-03-29 23:22:04 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-11-28 18:29:04 +0100
commit20e9c1101260dfbe3e169a259591408ccab61c22 (patch)
treee3f9b24e6130c64f6b75f623e4a2805df4478134
parent535b31d0e596394b05ab75dda00816bd1a109c11 (diff)
downloadlinux-stable-20e9c1101260dfbe3e169a259591408ccab61c22.tar.gz
linux-stable-20e9c1101260dfbe3e169a259591408ccab61c22.tar.bz2
linux-stable-20e9c1101260dfbe3e169a259591408ccab61c22.zip
virtio_console: fix uninitialized variable use
[ Upstream commit 2055997f983c6db7b5c3940ce5f8f822657d5bc3 ] We try to disable callbacks on c_ivq even without multiport even though that vq is not initialized in this configuration. Fixes: c743d09dbd01 ("virtio: console: Disable callbacks for virtqueues at start of S4 freeze") Suggested-by: Mike Galbraith <efault@gmx.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/char/virtio_console.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index d7ee031d776d..7de24040f39c 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -2203,14 +2203,16 @@ static int virtcons_freeze(struct virtio_device *vdev)
vdev->config->reset(vdev);
- virtqueue_disable_cb(portdev->c_ivq);
+ if (use_multiport(portdev))
+ virtqueue_disable_cb(portdev->c_ivq);
cancel_work_sync(&portdev->control_work);
cancel_work_sync(&portdev->config_work);
/*
* Once more: if control_work_handler() was running, it would
* enable the cb as the last step.
*/
- virtqueue_disable_cb(portdev->c_ivq);
+ if (use_multiport(portdev))
+ virtqueue_disable_cb(portdev->c_ivq);
remove_controlq_data(portdev);
list_for_each_entry(port, &portdev->ports, list) {