aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/char/tpm/tpm.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
index 27abfd93714d..0a475c7fe5ce 100644
--- a/drivers/char/tpm/tpm.c
+++ b/drivers/char/tpm/tpm.c
@@ -545,9 +545,10 @@ void tpm_get_timeouts(struct tpm_chip *chip)
545 if (rc) 545 if (rc)
546 goto duration; 546 goto duration;
547 547
548 if (be32_to_cpu(tpm_cmd.header.out.length) 548 if (be32_to_cpu(tpm_cmd.header.out.return_code) != 0 ||
549 != 4 * sizeof(u32)) 549 be32_to_cpu(tpm_cmd.header.out.length)
550 goto duration; 550 != sizeof(tpm_cmd.header.out) + sizeof(u32) + 4 * sizeof(u32))
551 return;
551 552
552 timeout_cap = &tpm_cmd.params.getcap_out.cap.timeout; 553 timeout_cap = &tpm_cmd.params.getcap_out.cap.timeout;
553 /* Don't overwrite default if value is 0 */ 554 /* Don't overwrite default if value is 0 */