summaryrefslogtreecommitdiff
path: root/drivers/tpm
diff options
context:
space:
mode:
authorChe-Liang Chiou <clchiou@chromium.org>2013-11-10 10:27:08 -0700
committerSimon Glass <sjg@chromium.org>2014-01-08 17:26:17 -0700
commit2c30af8f1861f09f217097460bfbea5ea691f8b8 (patch)
tree040622b8a6ad981c257d43fc397a2a27f4450e99 /drivers/tpm
parentb88eb329ce45c0c0f5471c8624f47bac35dd466e (diff)
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 <clchiou@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Diffstat (limited to 'drivers/tpm')
-rw-r--r--drivers/tpm/tpm_tis_sandbox.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/tpm/tpm_tis_sandbox.c b/drivers/tpm/tpm_tis_sandbox.c
index 80cf734f1c2..ed4b0391278 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;