@@ -1522,15 +1522,9 @@ static void remove_port_data(struct port *port)
while ((buf = virtqueue_detach_unused_buf(port->in_vq)))
free_buf(buf, true);
- /*
- * Check the out-queue for buffers. For VIRTIO_CONSOLE it is a
- * bug if this happens. But for RPROC_SERIAL the remote processor
- * may have crashed, leaving buffers hanging in the out-queue.
- */
- while ((buf = virtqueue_detach_unused_buf(port->out_vq))) {
- WARN_ON_ONCE(!is_rproc_serial(port->portdev->vdev));
+ /* Free pending buffers from the out-queue. */
+ while ((buf = virtqueue_detach_unused_buf(port->out_vq)))
free_buf(buf, true);
- }
}
/*
@@ -1655,6 +1649,10 @@ static void handle_control_message(struct ports_device *portdev,
*/
spin_lock_irq(&port->outvq_lock);
reclaim_consumed_buffers(port);
+
+ /* Free pending buffers from the out-queue. */
+ while ((buf = virtqueue_detach_unused_buf(port->out_vq)))
+ free_buf(buf, true);
spin_unlock_irq(&port->outvq_lock);
/*