提交 2de16a49 编写于 作者: A Amit Shah 提交者: Michael S. Tsirkin

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: NAmit Shah <amit.shah@redhat.com>
Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
上级 ec64213c
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册