sandbox: tpm: Correct handling of SANDBOX_TPM_PCR_NB
authorSimon Glass <sjg@chromium.org>
Sun, 18 Jul 2021 20:18:05 +0000 (14:18 -0600)
committerSimon Glass <sjg@chromium.org>
Sun, 1 Aug 2021 15:05:24 +0000 (09:05 -0600)
commit9f0b53564f035743a2ce60636cadd17c97937dee
treed1df2ae2383a02c0f3313bdd4bc43b1e612708df
parenta986216e348153705e0a019afc95da65baa1fff0
sandbox: tpm: Correct handling of SANDBOX_TPM_PCR_NB

This is the number of PCRs, so the current check is off by one. Also the
map itself should not be checked, just the resulting pcr_index, to avoid
confusing people who read the code.

Fix these problems.

Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/tpm/tpm2_tis_sandbox.c