From f743cfd44a46046ba7f4ccbd4d766f87acde169b Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 8 Apr 2010 09:46:16 -0600 Subject: [PATCH] --- yaml --- r: 189638 b: refs/heads/master c: 9ff4cfab82d27e9fda72315f911bbaa9516e04bc h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/char/virtio_console.c | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 41ee8133d3bb..40589dbab874 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 162a689a13ed61c0752726edb75427b2cd4186c1 +refs/heads/master: 9ff4cfab82d27e9fda72315f911bbaa9516e04bc diff --git a/trunk/drivers/char/virtio_console.c b/trunk/drivers/char/virtio_console.c index 48306bc733f7..86e9011325dc 100644 --- a/trunk/drivers/char/virtio_console.c +++ b/trunk/drivers/char/virtio_console.c @@ -416,20 +416,16 @@ static ssize_t send_buf(struct port *port, void *in_buf, size_t in_count) out_vq->vq_ops->kick(out_vq); if (ret < 0) { - len = 0; + in_count = 0; goto fail; } - /* - * Wait till the host acknowledges it pushed out the data we - * sent. Also ensure we return to userspace the number of - * bytes that were successfully consumed by the host. - */ + /* Wait till the host acknowledges it pushed out the data we sent. */ while (!out_vq->vq_ops->get_buf(out_vq, &len)) cpu_relax(); fail: /* We're expected to return the amount of data we wrote */ - return len; + return in_count; } /*