summaryrefslogtreecommitdiff
path: root/hw/ide
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2016-07-13 02:11:59 +0200
committerMarc-André Lureau <marcandre.lureau@redhat.com>2016-09-08 18:05:21 +0400
commite305a16510afa74eec20390479e349402e55ef4c (patch)
treea7b169b1ea91349fb47db68c74e66d635a11e518 /hw/ide
parentbd794065ffffe10721b6a95f1db52f2cc7953196 (diff)
downloadqemu-e305a16510afa74eec20390479e349402e55ef4c.tar.gz
portio: keep references on portio
The isa_register_portio_list() function allocates ioports data/state. Let's keep the reference to this data on some owner. This isn't enough to fix leaks, but at least, ASAN stops complaining of direct leaks. Further cleanup would require calling portio_list_del/destroy(). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/ide')
-rw-r--r--hw/ide/core.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/ide/core.c b/hw/ide/core.c
index 45b6df132c..b0e42a6562 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -2619,10 +2619,12 @@ void ide_init_ioport(IDEBus *bus, ISADevice *dev, int iobase, int iobase2)
{
/* ??? Assume only ISA and PCI configurations, and that the PCI-ISA
bridge has been setup properly to always register with ISA. */
- isa_register_portio_list(dev, iobase, ide_portio_list, bus, "ide");
+ isa_register_portio_list(dev, &bus->portio_list,
+ iobase, ide_portio_list, bus, "ide");
if (iobase2) {
- isa_register_portio_list(dev, iobase2, ide_portio2_list, bus, "ide");
+ isa_register_portio_list(dev, &bus->portio2_list,
+ iobase2, ide_portio2_list, bus, "ide");
}
}