* [PATCH] virtio_console: fix uninitialized variable use
@ 2017-03-29 20:27 Michael S. Tsirkin
2017-03-30 3:30 ` Mike Galbraith
0 siblings, 1 reply; 2+ messages in thread
From: Michael S. Tsirkin @ 2017-03-29 20:27 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, Mike Galbraith, virtualization, Arnd Bergmann,
Amit Shah
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>
---
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(-)
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index 5da4c8e..d0699c5 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -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) {
--
MST
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] virtio_console: fix uninitialized variable use
2017-03-29 20:27 [PATCH] virtio_console: fix uninitialized variable use Michael S. Tsirkin
@ 2017-03-30 3:30 ` Mike Galbraith
0 siblings, 0 replies; 2+ messages in thread
From: Mike Galbraith @ 2017-03-30 3:30 UTC (permalink / raw)
To: Michael S. Tsirkin, linux-kernel
Cc: Greg Kroah-Hartman, virtualization, Arnd Bergmann, Amit Shah
On Wed, 2017-03-29 at 23:27 +0300, Michael S. Tsirkin wrote:
> 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.
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-03-30 3:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-29 20:27 [PATCH] virtio_console: fix uninitialized variable use Michael S. Tsirkin
2017-03-30 3:30 ` Mike Galbraith
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).