aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/virtio_console.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/virtio_console.c')
-rw-r--r--drivers/char/virtio_console.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index 076d0358cf0e..e15dbe72edbf 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -1600,8 +1600,6 @@ static void virtcons_remove(struct virtio_device *vdev)
1600{ 1600{
1601 struct ports_device *portdev; 1601 struct ports_device *portdev;
1602 struct port *port, *port2; 1602 struct port *port, *port2;
1603 struct port_buffer *buf;
1604 unsigned int len;
1605 1603
1606 portdev = vdev->priv; 1604 portdev = vdev->priv;
1607 1605
@@ -1615,11 +1613,16 @@ static void virtcons_remove(struct virtio_device *vdev)
1615 1613
1616 unregister_chrdev(portdev->chr_major, "virtio-portsdev"); 1614 unregister_chrdev(portdev->chr_major, "virtio-portsdev");
1617 1615
1618 while ((buf = virtqueue_get_buf(portdev->c_ivq, &len))) 1616 if (use_multiport(portdev)) {
1619 free_buf(buf); 1617 struct port_buffer *buf;
1618 unsigned int len;
1620 1619
1621 while ((buf = virtqueue_detach_unused_buf(portdev->c_ivq))) 1620 while ((buf = virtqueue_get_buf(portdev->c_ivq, &len)))
1622 free_buf(buf); 1621 free_buf(buf);
1622
1623 while ((buf = virtqueue_detach_unused_buf(portdev->c_ivq)))
1624 free_buf(buf);
1625 }
1623 1626
1624 vdev->config->del_vqs(vdev); 1627 vdev->config->del_vqs(vdev);
1625 kfree(portdev->in_vqs); 1628 kfree(portdev->in_vqs);