To avoid truncating the uint32_t return value from tpm_cmd_get_size() declare len as uint32_t rather than uint16_t.
Signed-off-by: Stefan Berger <[email protected]> --- hw/tpm/tpm_tis_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/tpm/tpm_tis_common.c b/hw/tpm/tpm_tis_common.c index 4ba228116b..8fa1bee771 100644 --- a/hw/tpm/tpm_tis_common.c +++ b/hw/tpm/tpm_tis_common.c @@ -481,7 +481,7 @@ static void tpm_tis_mmio_write(void *opaque, hwaddr addr, uint8_t locty = tpm_tis_locality_from_addr(addr); uint8_t active_locty, l; int c, set_new_locty = 1; - uint16_t len; + uint32_t len; uint32_t mask = (size == 1) ? 0xff : ((size == 2) ? 0xffff : ~0); trace_tpm_tis_mmio_write(size, addr, val); -- 2.55.0
