xemu/hw/sd
Peter Maydell c0983085d1 hw/sd/sdhci: Don't leak memory region in sdhci_sysbus_realize()
In sdhci_sysbus_realize() we override the initialization of
s->iomem that sdhci_common_realize() performs. However we
don't destroy the old memory region before reinitializing
it, which means that the memory allocated for mr->name in
memory_region_do_init() is leaked.

Since sdhci_initfn() already initializes s->io_ops to
&sdhci_mmio_ops, always use that in sdhci_common_realize()
and remove the now-unnecessary reinitialization of the
MMIO region from sdhci_sysbus_realize().

Spotted by clang's leak sanitizer.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20181204132952.2601-4-peter.maydell@linaro.org
2018-12-14 13:30:54 +00:00
..
bcm2835_sdhost.c hw/sd/bcm2835_sdhost: Fix PIO mode writes 2018-07-23 15:21:26 +01:00
core.c sd: Don't trace SDRequest crc field 2018-06-29 15:11:19 +01:00
Makefile.objs sdcard: Display command name when tracing CMD/ACMD 2018-03-09 17:09:44 +00:00
milkymist-memcard.c sdcard: Use the ldst API 2018-06-29 15:11:20 +01:00
omap_mmc.c hw/sd/omap_mmc: Split 'pseudo-reset' from 'power-on-reset' 2018-07-09 14:51:34 +01:00
pl181.c sdcard: Use the ldst API 2018-06-29 15:11:20 +01:00
pxa2xx_mmci.c hw/sd/pxa2xx_mmci: add read/write() trace events 2018-01-11 13:25:39 +00:00
sd.c hw/sd: Use the IEC binary prefix definitions 2018-07-02 15:41:16 +02:00
sdhci-internal.h sdhci: add i.MX SD Stable Clock bit 2018-08-20 11:24:32 +01:00
sdhci.c hw/sd/sdhci: Don't leak memory region in sdhci_sysbus_realize() 2018-12-14 13:30:54 +00:00
sdmmc-internal.c sdcard: Display command name when tracing CMD/ACMD 2018-03-09 17:09:44 +00:00
sdmmc-internal.h sdcard: Display command name when tracing CMD/ACMD 2018-03-09 17:09:44 +00:00
ssi-sd.c ssi-sd: Make devices picking up backends unavailable with -device 2018-10-24 07:50:16 +01:00
trace-events Pull request 2018-06-30 13:59:53 +01:00