Received: from eggs.gnu.org ([2001:4830:134:3::10]:50236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agIBB-00071W-Cv for qemu-devel@nongnu.org; Wed, 16 Mar 2016 16:36:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1agIB6-0005q6-DK for qemu-devel@nongnu.org; Wed, 16 Mar 2016 16:36:29 -0400 Received: from e17.ny.us.ibm.com ([129.33.205.207]:42858) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agIB6-0005pw-9W for qemu-devel@nongnu.org; Wed, 16 Mar 2016 16:36:24 -0400 Received: from localhost by e17.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 16 Mar 2016 16:36:22 -0400 From: Stefan Berger Date: Wed, 16 Mar 2016 16:36:16 -0400 Message-Id: <1458160576-1076-1-git-send-email-stefanb@us.ibm.com> Subject: [Qemu-devel] [PATCH] tpm: Fix write to file descriptor function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-trivial@nongnu.org Cc: Stefan Berger , qemu-devel@nongnu.org, Stefan Berger Fix a bug introduced in 46f296c while moving send_all to the tpm_passthrough code. Signed-off-by: Stefan Berger --- hw/tpm/tpm_passthrough.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/tpm/tpm_passthrough.c b/hw/tpm/tpm_passthrough.c index e98efb7..e88c0d2 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) { -- 2.4.3