diff options
| -rw-r--r-- | drivers/char/tpm/tpm.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c index 1f46f1cd9225..36e0fa161c2b 100644 --- a/drivers/char/tpm/tpm.c +++ b/drivers/char/tpm/tpm.c | |||
| @@ -364,12 +364,14 @@ unsigned long tpm_calc_ordinal_duration(struct tpm_chip *chip, | |||
| 364 | tpm_protected_ordinal_duration[ordinal & | 364 | tpm_protected_ordinal_duration[ordinal & |
| 365 | TPM_PROTECTED_ORDINAL_MASK]; | 365 | TPM_PROTECTED_ORDINAL_MASK]; |
| 366 | 366 | ||
| 367 | if (duration_idx != TPM_UNDEFINED) | 367 | if (duration_idx != TPM_UNDEFINED) { |
| 368 | duration = chip->vendor.duration[duration_idx]; | 368 | duration = chip->vendor.duration[duration_idx]; |
| 369 | if (duration <= 0) | 369 | /* if duration is 0, it's because chip->vendor.duration wasn't */ |
| 370 | /* filled yet, so we set the lowest timeout just to give enough */ | ||
| 371 | /* time for tpm_get_timeouts() to succeed */ | ||
| 372 | return (duration <= 0 ? HZ : duration); | ||
| 373 | } else | ||
| 370 | return 2 * 60 * HZ; | 374 | return 2 * 60 * HZ; |
| 371 | else | ||
| 372 | return duration; | ||
| 373 | } | 375 | } |
| 374 | EXPORT_SYMBOL_GPL(tpm_calc_ordinal_duration); | 376 | EXPORT_SYMBOL_GPL(tpm_calc_ordinal_duration); |
| 375 | 377 | ||
