summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/tpm-v2.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/tpm-v2.c b/lib/tpm-v2.c
index aa02a9e9611..9ca7933c094 100644
--- a/lib/tpm-v2.c
+++ b/lib/tpm-v2.c
@@ -344,7 +344,10 @@ u32 tpm2_pcr_extend(struct udevice *dev, u32 index, u32 algorithm,
if (!tpm2_check_active_banks(dev)) {
log_err("Cannot extend PCRs if all the TPM enabled algorithms are not supported\n");
- return -EINVAL;
+
+ ret = tpm2_pcr_allocate(dev, 0);
+ if (ret)
+ return -EINVAL;
}
/*
* Fill the command structure starting from the first buffer: