qemu-e2k/hw
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
..
9pfs
acpi
adc
alpha
arm hw/arm/mps2-tz.c: Free mscname string in make_dma() 2018-12-14 13:30:54 +00:00
audio
block hw/block/tc58128.c: Don't use load_image() 2018-12-14 13:30:52 +00:00
bt
char
core hw/core/loader.c: Remove load_image() 2018-12-14 13:30:53 +00:00
cpu
cris
display vmstate: constify VMStateField 2018-11-27 15:35:15 +01:00
dma
gpio
hppa
hyperv
i2c i2c: Move typedef of bitbang_i2c_interface to i2c.h 2018-12-12 10:01:13 +01:00
i386 hw/i386/multiboot.c: Don't use load_image() 2018-12-14 13:30:51 +00:00
ide
input
intc Rename cpu_physical_memory_write_rom() to address_space_write_rom() 2018-12-14 13:30:48 +00:00
ipack
ipmi
isa
lm32
m68k
mem memory-device: avoid overflows on very huge devices 2018-12-11 15:45:22 -02:00
microblaze
mips
misc Rename cpu_physical_memory_write_rom() to address_space_write_rom() 2018-12-14 13:30:48 +00:00
moxie
net
nios2
nvram vmstate: constify VMStateField 2018-11-27 15:35:15 +01:00
openrisc
pci hw/pci/pci.c: Don't use load_image() 2018-12-14 13:30:51 +00:00
pci-bridge
pci-host
pcmcia
ppc hw/ppc/ppc405_boards: Don't use load_image() 2018-12-14 13:30:50 +00:00
rdma
riscv
s390x hw/s390x/virtio-ccw.c: Don't take address of fields in packed structs 2018-12-12 10:39:28 +01:00
scsi vmstate: constify VMStateField 2018-11-27 15:35:15 +01:00
sd hw/sd/sdhci: Don't leak memory region in sdhci_sysbus_realize() 2018-12-14 13:30:54 +00:00
sh4
smbios hw/smbios/smbios.c: Don't use load_image() 2018-12-14 13:30:50 +00:00
sparc Rename cpu_physical_memory_write_rom() to address_space_write_rom() 2018-12-14 13:30:48 +00:00
sparc64
ssi
timer hw/timer/sun4v-rtc: Fix tracing at sun4v_rtc_write() 2018-12-11 15:45:22 -02:00
tpm tpm: Make sure the locality received from backend is valid 2018-12-04 10:21:25 -05:00
tricore
unicore32
usb usb: mtp fixes. 2018-12-03 19:57:59 +00:00
vfio vfio-ap: flag as compatible with balloon 2018-12-12 10:39:28 +01:00
virtio Trivial patches (2018-12-11) 2018-12-11 22:26:44 +00:00
watchdog
xen
xenpv
xtensa
Makefile.objs