diff options
author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2023-05-20 07:45:10 +0200 |
---|---|---|
committer | Alistair Francis <alistair.francis@wdc.com> | 2023-06-13 17:19:42 +1000 |
commit | a828ba9d46972e32c135f386dd08c02aa7eb8f1d (patch) | |
tree | 7505b89b3034a3176982989cc823be502a3d79b0 /include | |
parent | 8696b74a6fed86a9d2bd7e947d0490c2459a8aa6 (diff) | |
download | qemu-a828ba9d46972e32c135f386dd08c02aa7eb8f1d.zip qemu-a828ba9d46972e32c135f386dd08c02aa7eb8f1d.tar.gz qemu-a828ba9d46972e32c135f386dd08c02aa7eb8f1d.tar.bz2 |
hw/riscv/opentitan: Correct OpenTitanState parent type/size
OpenTitanState is the 'machine' (or 'board') state: it isn't
a SysBus device, but inherits from the MachineState type.
Correct the instance size.
Doing so we avoid leaking an OpenTitanState pointer in
opentitan_machine_init().
Fixes: fe0fe4735e ("riscv: Initial commit of OpenTitan machine")
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Message-Id: <20230520054510.68822-6-philmd@linaro.org>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/hw/riscv/opentitan.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/hw/riscv/opentitan.h b/include/hw/riscv/opentitan.h index 806ff73..609473d 100644 --- a/include/hw/riscv/opentitan.h +++ b/include/hw/riscv/opentitan.h @@ -55,10 +55,11 @@ struct LowRISCIbexSoCState { }; #define TYPE_OPENTITAN_MACHINE MACHINE_TYPE_NAME("opentitan") +OBJECT_DECLARE_SIMPLE_TYPE(OpenTitanState, OPENTITAN_MACHINE) typedef struct OpenTitanState { /*< private >*/ - SysBusDevice parent_obj; + MachineState parent_obj; /*< public >*/ LowRISCIbexSoCState soc; |