mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-25 06:00:43 +00:00
fd973ca696
The second check on pcr_map in sandbox_tpm2_xfer() is wrong. It should check for pcr_map not being empty. Instead, it is a pure copy/paste of the first check which is redundant. This has been found thanks to a Coverity Scan report: CID 183370: Memory - illegal accesses (UNINIT) Using uninitialized value "pcr_index". put_unaligned_be32(tpm->pcr_extensions[pcr_index], recv); This is because pcr_index is initialized only if the user input is correct, ie. at least one valid bit is set in pcr_map. Fix the second check and also initialize pcr_index to 0 (which is harmless in case of error) to make Coverity Scan happy. Reported-by: Tom Rini <trini@konsulko.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Simon Glass <sjg@chromium.org> |
||
---|---|---|
.. | ||
Kconfig | ||
Makefile | ||
tpm-uclass.c | ||
tpm2_tis_sandbox.c | ||
tpm2_tis_spi.c | ||
tpm_atmel_twi.c | ||
tpm_internal.h | ||
tpm_tis.h | ||
tpm_tis_infineon.c | ||
tpm_tis_lpc.c | ||
tpm_tis_sandbox.c | ||
tpm_tis_st33zp24_i2c.c | ||
tpm_tis_st33zp24_spi.c |