virtio_console: init work unconditionally
authorMichael S. Tsirkin <mst@redhat.com>
Thu, 5 Mar 2015 00:15:30 +0000 (10:45 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Thu, 5 Mar 2015 03:06:17 +0000 (13:36 +1030)
when multiport is off, we don't initialize config work,
but we then cancel uninitialized control_work on freeze.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: stable@kernel.org
drivers/char/virtio_console.c

index fae2dbbf57459fe4f4ac01bb0415a02abbda9e18..def736ddfc0e52b6de8b236fa10e1bb90cb3b2c1 100644 (file)
@@ -2040,12 +2040,13 @@ static int virtcons_probe(struct virtio_device *vdev)
 
        virtio_device_ready(portdev->vdev);
 
+       INIT_WORK(&portdev->control_work, &control_work_handler);
+
        if (multiport) {
                unsigned int nr_added_bufs;
 
                spin_lock_init(&portdev->c_ivq_lock);
                spin_lock_init(&portdev->c_ovq_lock);
-               INIT_WORK(&portdev->control_work, &control_work_handler);
 
                nr_added_bufs = fill_queue(portdev->c_ivq,
                                           &portdev->c_ivq_lock);