summaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorAmit Shah <amit.shah@redhat.com>2012-12-10 00:15:12 +0100
committerRusty Russell <rusty@rustcorp.com.au>2012-12-18 05:50:34 +0100
commit49e86f16866fbf8e3c9a6b0770eb6f3c167f4b72 (patch)
tree3979a5769d8f03d723b306f7f5bdbcb3e5d0a81e /drivers/char
parentvirtio_net: don't rely on virtqueue_add_buf() returning capacity. (diff)
downloadlinux-49e86f16866fbf8e3c9a6b0770eb6f3c167f4b72.tar.xz
linux-49e86f16866fbf8e3c9a6b0770eb6f3c167f4b72.zip
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>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/virtio_console.c2
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)
ret = virtqueue_add_buf(vq, sg, 0, 1, buf, GFP_ATOMIC);
virtqueue_kick(vq);
+ if (!ret)
+ ret = vq->num_free;
return ret;
}