virtio-serial: Assert for virtio queue ready before virtqueue operations
In addition to the previous fix for calling do_flush_queued_data() only when the virtqueue is ready, ensure do_flush_queued_data() gets a vq that's suitably initialised. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
6b611d3ab8
commit
fd11a78be8
@ -117,6 +117,7 @@ static void do_flush_queued_data(VirtIOSerialPort *port, VirtQueue *vq,
|
||||
VirtQueueElement elem;
|
||||
|
||||
assert(port || discard);
|
||||
assert(virtio_queue_ready(vq));
|
||||
|
||||
while ((discard || !port->throttled) && virtqueue_pop(vq, &elem)) {
|
||||
uint8_t *buf;
|
||||
|
Loading…
Reference in New Issue
Block a user