diff options
Diffstat (limited to 'drivers/char/virtio_console.c')
-rw-r--r-- | drivers/char/virtio_console.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 8c99bf1b5e9f..e3fb5296cf25 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c | |||
@@ -1099,6 +1099,13 @@ static int remove_port(struct port *port) | |||
1099 | { | 1099 | { |
1100 | struct port_buffer *buf; | 1100 | struct port_buffer *buf; |
1101 | 1101 | ||
1102 | if (port->guest_connected) { | ||
1103 | port->guest_connected = false; | ||
1104 | port->host_connected = false; | ||
1105 | wake_up_interruptible(&port->waitqueue); | ||
1106 | send_control_msg(port, VIRTIO_CONSOLE_PORT_OPEN, 0); | ||
1107 | } | ||
1108 | |||
1102 | spin_lock_irq(&port->portdev->ports_lock); | 1109 | spin_lock_irq(&port->portdev->ports_lock); |
1103 | list_del(&port->list); | 1110 | list_del(&port->list); |
1104 | spin_unlock_irq(&port->portdev->ports_lock); | 1111 | spin_unlock_irq(&port->portdev->ports_lock); |
@@ -1120,9 +1127,6 @@ static int remove_port(struct port *port) | |||
1120 | hvc_remove(port->cons.hvc); | 1127 | hvc_remove(port->cons.hvc); |
1121 | #endif | 1128 | #endif |
1122 | } | 1129 | } |
1123 | if (port->guest_connected) | ||
1124 | send_control_msg(port, VIRTIO_CONSOLE_PORT_OPEN, 0); | ||
1125 | |||
1126 | sysfs_remove_group(&port->dev->kobj, &port_attribute_group); | 1130 | sysfs_remove_group(&port->dev->kobj, &port_attribute_group); |
1127 | device_destroy(pdrvdata.class, port->dev->devt); | 1131 | device_destroy(pdrvdata.class, port->dev->devt); |
1128 | cdev_del(&port->cdev); | 1132 | cdev_del(&port->cdev); |