aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author[email protected] <[email protected]>2016-07-14 18:07:18 -0700
committerJarkko Sakkinen <[email protected]>2016-07-19 17:43:38 +0300
commit1b0612b04090e416828c0dd5ed197b0913d834a0 (patch)
tree2a55178a9b891bab715a0e4dedf70f70c77af64b
parent79b591c091b31291fecd9551db0a67fdc5901d50 (diff)
tpm: fix byte-order for the value read by tpm2_get_tpm_pt
The result must be converted from BE byte order, which is used by the TPM2 protocol. This has not popped out because tpm2_get_tpm_pt() has been only used for probing. Fixes: 7a1d7e6dd76a ("tpm: TPM 2.0 baseline support") Change-Id: I7d71cd379b1a3b7659d20a1b6008216762596590 Signed-off-by: Andrey Pronin <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Reviewed-by: Jarkko Sakkinen <[email protected]> Signed-off-by: Jarkko Sakkinen <[email protected]>
-rw-r--r--drivers/char/tpm/tpm2-cmd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/tpm/tpm2-cmd.c b/drivers/char/tpm/tpm2-cmd.c
index a1673dcb4cae..a88b31e7fe72 100644
--- a/drivers/char/tpm/tpm2-cmd.c
+++ b/drivers/char/tpm/tpm2-cmd.c
@@ -703,7 +703,7 @@ ssize_t tpm2_get_tpm_pt(struct tpm_chip *chip, u32 property_id, u32 *value,
rc = tpm_transmit_cmd(chip, &cmd, sizeof(cmd), desc);
if (!rc)
- *value = cmd.params.get_tpm_pt_out.value;
+ *value = be32_to_cpu(cmd.params.get_tpm_pt_out.value);
return rc;
}