summaryrefslogtreecommitdiff
path: root/firmware/lib/rollback_index.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/lib/rollback_index.c')
-rw-r--r--firmware/lib/rollback_index.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/firmware/lib/rollback_index.c b/firmware/lib/rollback_index.c
index 306e9032..49b3a84b 100644
--- a/firmware/lib/rollback_index.c
+++ b/firmware/lib/rollback_index.c
@@ -667,10 +667,16 @@ uint32_t RollbackBackupWrite(uint8_t *raw)
uint32_t RollbackKernelLock(int recovery_mode)
{
- if (recovery_mode)
+ static int kernel_locked = 0;
+ uint32_t r;
+
+ if (recovery_mode || kernel_locked)
return TPM_SUCCESS;
- else
- return TlclLockPhysicalPresence();
+
+ r = TlclLockPhysicalPresence();
+ if (TPM_SUCCESS == r)
+ kernel_locked = 1;
+ return r;
}
#endif /* DISABLE_ROLLBACK_TPM */