[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 09/11] tpm_tis_sysbus: fix crash when PPI is enabled
From: |
Joelle van Dyne |
Subject: |
[PATCH 09/11] tpm_tis_sysbus: fix crash when PPI is enabled |
Date: |
Wed, 12 Jul 2023 20:51:14 -0700 |
If 'ppi' property is set, then `tpm_ppi_reset` is called on reset
which SEGFAULTs because `tpmppi->buf` is not allocated.
Signed-off-by: Joelle van Dyne <j@getutm.app>
---
hw/tpm/tpm_tis_sysbus.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/tpm/tpm_tis_sysbus.c b/hw/tpm/tpm_tis_sysbus.c
index 45e63efd63..1014d5d993 100644
--- a/hw/tpm/tpm_tis_sysbus.c
+++ b/hw/tpm/tpm_tis_sysbus.c
@@ -124,6 +124,10 @@ static void tpm_tis_sysbus_realizefn(DeviceState *dev,
Error **errp)
error_setg(errp, "'tpmdev' property is required");
return;
}
+
+ if (s->ppi_enabled) {
+ sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->ppi.ram);
+ }
}
static void tpm_tis_sysbus_class_init(ObjectClass *klass, void *data)
--
2.39.2 (Apple Git-143)
- Re: [PATCH 04/11] tpm_crb: use a single read-as-mem/write-as-mmio mapping, (continued)
- [PATCH 10/11] tpm_tis_sysbus: move DSDT AML generation to device, Joelle van Dyne, 2023/07/12
- [PATCH 05/11] tpm_crb: use the ISA bus, Joelle van Dyne, 2023/07/12
- [PATCH 07/11] hw/arm/virt: add plug handler for TPM on SysBus, Joelle van Dyne, 2023/07/12
- [PATCH 08/11] hw/loongarch/virt: add plug handler for TPM on SysBus, Joelle van Dyne, 2023/07/12
- [PATCH 11/11] tpm_crb_sysbus: introduce TPM CRB SysBus device, Joelle van Dyne, 2023/07/12
- [PATCH 09/11] tpm_tis_sysbus: fix crash when PPI is enabled,
Joelle van Dyne <=
- Re: [PATCH 00/11] tpm: introduce TPM CRB SysBus device, Stefan Berger, 2023/07/13