virtio_console: fix uninitialized variable use
Subsystems (3)
Michael S. Tsirkin
maintainerPATCH 1/1 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.
---
Hi Mike
if you like, pls send me your Signed-off-by and I'll change the patch to make you an author. More importantly, pls let me know whether this helps resolve the issues about hybernation for you!
drivers/char/virtio_console.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/char/virtio_console.c +4 -2
@@ -2202,14 +2202,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) {
Signature · 1 line
MST
Quoted 3 lines · Michael S. Tsirkin
Hi Mike
if you like, pls send me your Signed-off-by and I'll change the patch to make you an author.
Nah, it's perfect as it is. While I was pretty darn sure it was generic, I intentionally posted it as diagnostic info.
Quoted 2 lines
More importantly, pls let me know whether this helps resolve the issues about hybernation for you!
Well, it prevents kaboom with VIRTIO_CONSOLE_F_MULTIPORT turned off, but no, it does nada wrt the warnings.
-Mike
Quoted 3 lines · Michael S. Tsirkin
Hi Mike
if you like, pls send me your Signed-off-by and I'll change the patch to make you an author.
Nah, it's perfect as it is. While I was pretty darn sure it was generic, I intentionally posted it as diagnostic info.
Quoted 2 lines
More importantly, pls let me know whether this helps resolve the issues about hybernation for you!
Well, it prevents kaboom with VIRTIO_CONSOLE_F_MULTIPORT turned off, but no, it does nada wrt the warnings.
-Mike