Revert "tpm: Fix buffer access in tpm2_get_tpm_pt()"
This reverts commit 7ecd237e5036367ee9f0d2081dc2ae27bb103742.
diff --git a/drivers/char/tpm/tpm2-cmd.c b/drivers/char/tpm/tpm2-cmd.c
index 89635bb..1385c2c 100644
--- a/drivers/char/tpm/tpm2-cmd.c
+++ b/drivers/char/tpm/tpm2-cmd.c
@@ -706,16 +706,7 @@
if (!rc) {
out = (struct tpm2_get_cap_out *)
&buf.data[TPM_HEADER_SIZE];
- /*
- * To prevent failing boot up of some systems, Infineon TPM2.0
- * returns SUCCESS on TPM2_Startup in field upgrade mode. Also
- * the TPM2_Getcapability command returns a zero length list
- * in field upgrade mode.
- */
- if (be32_to_cpu(out->property_cnt) > 0)
- *value = be32_to_cpu(out->value);
- else
- rc = -ENODATA;
+ *value = be32_to_cpu(out->value);
}
tpm_buf_destroy(&buf);
return rc;