Commit 2055997f authored by Michael S. Tsirkin's avatar Michael S. Tsirkin

virtio_console: fix uninitialized variable use

We try to disable callbacks on c_ivq even without multiport
even though that vq is not initialized in this configuration.

Fixes: c743d09d ("virtio: console: Disable callbacks for virtqueues at start of S4 freeze")
Suggested-by: default avatarMike Galbraith <efault@gmx.de>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent fe36cbe0
...@@ -2202,6 +2202,7 @@ static int virtcons_freeze(struct virtio_device *vdev) ...@@ -2202,6 +2202,7 @@ static int virtcons_freeze(struct virtio_device *vdev)
vdev->config->reset(vdev); vdev->config->reset(vdev);
if (use_multiport(portdev))
virtqueue_disable_cb(portdev->c_ivq); virtqueue_disable_cb(portdev->c_ivq);
cancel_work_sync(&portdev->control_work); cancel_work_sync(&portdev->control_work);
cancel_work_sync(&portdev->config_work); cancel_work_sync(&portdev->config_work);
...@@ -2209,6 +2210,7 @@ static int virtcons_freeze(struct virtio_device *vdev) ...@@ -2209,6 +2210,7 @@ static int virtcons_freeze(struct virtio_device *vdev)
* Once more: if control_work_handler() was running, it would * Once more: if control_work_handler() was running, it would
* enable the cb as the last step. * enable the cb as the last step.
*/ */
if (use_multiport(portdev))
virtqueue_disable_cb(portdev->c_ivq); virtqueue_disable_cb(portdev->c_ivq);
remove_controlq_data(portdev); remove_controlq_data(portdev);
......
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