]> git.proxmox.com Git - mirror_qemu.git/commitdiff
tpm: Fix write to file descriptor function
authorStefan Berger <stefanb@us.ibm.com>
Wed, 6 Apr 2016 00:21:50 +0000 (20:21 -0400)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 13 Apr 2016 16:52:34 +0000 (19:52 +0300)
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>
hw/tpm/tpm_passthrough.c

index e98efb709ed5afef730b3b8335739bda9c3bd803..e88c0d20bc7de32ee533250289c5d675abb57012 100644 (file)
@@ -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) {