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

Commit 2de16a49 authored by Amit Shah's avatar Amit Shah Committed by Michael S. Tsirkin
Browse files

virtio: console: Check if port is valid in resize_console



The console port could have been hot-unplugged. Check if it is valid
before working on it.

Signed-off-by: default avatarAmit Shah <amit.shah@redhat.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent ec64213c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -681,6 +681,10 @@ static void resize_console(struct port *port)
	struct virtio_device *vdev;
	struct winsize ws;

	/* The port could have been hot-unplugged */
	if (!port)
		return;

	vdev = port->portdev->vdev;
	if (virtio_has_feature(vdev, VIRTIO_CONSOLE_F_SIZE)) {
		vdev->config->get(vdev,