From: Che-Liang Chiou Date: Sun, 10 Nov 2013 17:27:08 +0000 (-0700) Subject: sandbox: tpm: Fix nvwrite command X-Git-Tag: v2014.01-rc3~12 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2c30af8f1861f09f217097460bfbea5ea691f8b8;p=u-boot sandbox: tpm: Fix nvwrite command The original codes misused recvbuf in source buffer instead of sendbuf, and read from incorrect offset 14 instead of 22. Signed-off-by: Che-Liang Chiou Signed-off-by: Simon Glass Reviewed-by: Simon Glass Tested-by: Che-Liang Chiou --- diff --git a/drivers/tpm/tpm_tis_sandbox.c b/drivers/tpm/tpm_tis_sandbox.c index 80cf734f1c..ed4b039127 100644 --- a/drivers/tpm/tpm_tis_sandbox.c +++ b/drivers/tpm/tpm_tis_sandbox.c @@ -190,9 +190,7 @@ int tis_sendrecv(const u8 *sendbuf, size_t send_size, if (seq < 0) return -1; printf("tpm: nvwrite index=%#02x, len=%#02x\n", index, length); - memcpy(&tpm->nvdata[seq], - recvbuf + TPM_RESPONSE_HEADER_LENGTH + sizeof(uint32_t), - length); + memcpy(&tpm->nvdata[seq], sendbuf + 22, length); *recv_len = 12; memset(recvbuf, '\0', *recv_len); break;