diff options
author | Amit Shah <amit.shah@redhat.com> | 2012-12-09 18:15:12 -0500 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2012-12-17 23:50:34 -0500 |
commit | 49e86f16866fbf8e3c9a6b0770eb6f3c167f4b72 (patch) | |
tree | 3979a5769d8f03d723b306f7f5bdbcb3e5d0a81e | |
parent | 9ed4cb073438e2154778f0d693d966359afd6549 (diff) |
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>
-rw-r--r-- | drivers/char/virtio_console.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 8ab9c3d4bf13..89bdc31a3dc6 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c | |||
@@ -396,6 +396,8 @@ static int add_inbuf(struct virtqueue *vq, struct port_buffer *buf) | |||
396 | 396 | ||
397 | ret = virtqueue_add_buf(vq, sg, 0, 1, buf, GFP_ATOMIC); | 397 | ret = virtqueue_add_buf(vq, sg, 0, 1, buf, GFP_ATOMIC); |
398 | virtqueue_kick(vq); | 398 | virtqueue_kick(vq); |
399 | if (!ret) | ||
400 | ret = vq->num_free; | ||
399 | return ret; | 401 | return ret; |
400 | } | 402 | } |
401 | 403 | ||