From: Stefan Berger Date: Wed, 6 Apr 2016 00:21:50 +0000 (-0400) Subject: tpm: Fix write to file descriptor function X-Git-Tag: qemu-xen-4.8.0-rc1~321^2~1 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=e7658fcc4c29a29c578acde26f7714023b93b46e;p=qemu-xen.git 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 Acked-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- 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) {