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>
This commit is contained in:
Amit Shah 2012-12-10 09:45:12 +10:30 committed by Rusty Russell
parent 9ed4cb0734
commit 49e86f1686
1 changed files with 2 additions and 0 deletions

View File

@ -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); ret = virtqueue_add_buf(vq, sg, 0, 1, buf, GFP_ATOMIC);
virtqueue_kick(vq); virtqueue_kick(vq);
if (!ret)
ret = vq->num_free;
return ret; return ret;
} }