[U-Boot] [PATCH 22/32] sandbox: tpm: Fix nvwrite command

Simon Glass sjg at chromium.org
Sun Nov 10 18:27:08 CET 2013


From: Che-Liang Chiou <clchiou at chromium.org>

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 <clchiou at chromium.org>

Signed-off-by: Simon Glass <sjg at chromium.org>
Reviewed-by: Simon Glass <sjg at chromium.org>
Tested-by: Che-Liang Chiou <clchiou at chromium.org>
---
 drivers/tpm/tpm_tis_sandbox.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/tpm/tpm_tis_sandbox.c b/drivers/tpm/tpm_tis_sandbox.c
index 80cf734..ed4b039 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;
-- 
1.8.4.1



More information about the U-Boot mailing list