Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0b39fb19 authored by Michael S. Tsirkin's avatar Michael S. Tsirkin Committed by Sasha Levin
Browse files

virtio_console: init work unconditionally



[ Upstream commit 4f6e24ed9de8634d6471ef86b382cba6d4e57ca8 ]

when multiport is off, we don't initialize config work,
but we then cancel uninitialized control_work on freeze.

Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Reviewed-by: default avatarAmit Shah <amit.shah@redhat.com>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
Cc: stable@kernel.org
Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
parent 5850222d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2026,12 +2026,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);