commit | 49e86f16866fbf8e3c9a6b0770eb6f3c167f4b72 | [log] [tgz] |
---|---|---|
author | Amit Shah <amit.shah@redhat.com> | Mon Dec 10 09:45:12 2012 +1030 |
committer | Rusty Russell <rusty@rustcorp.com.au> | Tue Dec 18 15:20:34 2012 +1030 |
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>
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 8ab9c3d..89bdc31 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c
@@ -396,6 +396,8 @@ ret = virtqueue_add_buf(vq, sg, 0, 1, buf, GFP_ATOMIC); virtqueue_kick(vq); + if (!ret) + ret = vq->num_free; return ret; }