qemu-patch-raspberry4/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
Makefile.objs
milkymist-memcard.c
omap_mmc.c hw/sd/omap_mmc: Split 'pseudo-reset' from 'power-on-reset' 2018-07-09 14:51:34 +01:00
pl181.c
pxa2xx_mmci.c
sd.c
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
sdmmc-internal.h
ssi-sd.c ssi-sd: Make devices picking up backends unavailable with -device 2018-10-24 07:50:16 +01:00
trace-events