hw/arm: Don't allocate separate MemoryRegions in stm32 SoC realize
In the realize methods of the stm32f100 and stm32f205 SoC objects, we call g_new() to create new MemoryRegion objects for the sram, flash, and flash_alias. This is unnecessary (and leaves open the possibility of leaking the allocations if we exit from realize with an error). Make these MemoryRegions member fields of the device state struct instead, as stm32f405 already does. Signed-off-by:Peter Maydell <peter.maydell@linaro.org> Reviewed-by:
Alexandre Iooss <erdnaxe@crans.org> Reviewed-by:
Alistair Francis <alistair.francis@wdc.com> Reviewed-by:
Luc Michel <luc@lmichel.fr> Message-id: 20210812093356.1946-11-peter.maydell@linaro.org
Showing
- hw/arm/stm32f100_soc.c 7 additions, 10 deletionshw/arm/stm32f100_soc.c
- hw/arm/stm32f205_soc.c 7 additions, 10 deletionshw/arm/stm32f205_soc.c
- include/hw/arm/stm32f100_soc.h 4 additions, 0 deletionsinclude/hw/arm/stm32f100_soc.h
- include/hw/arm/stm32f205_soc.h 4 additions, 0 deletionsinclude/hw/arm/stm32f205_soc.h
Please register or sign in to comment