Browse Source

virtio: console: don't rely on virtqueue_add_buf() returning capacity.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Amit Shah 13 năm trước cách đây
mục cha
commit
49e86f1686
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      drivers/char/virtio_console.c

+ 2 - 0
drivers/char/virtio_console.c

@@ -396,6 +396,8 @@ static int add_inbuf(struct virtqueue *vq, struct port_buffer *buf)
 
 	ret = virtqueue_add_buf(vq, sg, 0, 1, buf, GFP_ATOMIC);
 	virtqueue_kick(vq);
+	if (!ret)
+		ret = vq->num_free;
 	return ret;
 }