summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorStefan Berger <stefanb@us.ibm.com>2016-04-05 20:21:50 -0400
committerMichael S. Tsirkin <mst@redhat.com>2016-04-13 19:52:34 +0300
commite7658fcc4c29a29c578acde26f7714023b93b46e (patch)
treee20427db0e2c497336f338a4773740413d43c588
parent52e38eb0512585a5fadb431a65997b602d44874b (diff)
downloadfocaccia-qemu-e7658fcc4c29a29c578acde26f7714023b93b46e.tar.gz
focaccia-qemu-e7658fcc4c29a29c578acde26f7714023b93b46e.zip
tpm: Fix write to file descriptor function
Fix a bug introduced in commit 46f296c while moving send_all to the
tpm_passthrough code. Fix the name of the variable used in the loop.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r--hw/tpm/tpm_passthrough.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/tpm/tpm_passthrough.c b/hw/tpm/tpm_passthrough.c
index e98efb709e..e88c0d20bc 100644
--- a/hw/tpm/tpm_passthrough.c
+++ b/hw/tpm/tpm_passthrough.c
@@ -86,7 +86,7 @@ static int tpm_passthrough_unix_write(int fd, const uint8_t *buf, uint32_t len)
     int ret, remain;
 
     remain = len;
-    while (len > 0) {
+    while (remain > 0) {
         ret = write(fd, buf, remain);
         if (ret < 0) {
             if (errno != EINTR && errno != EAGAIN) {