summaryrefslogtreecommitdiffstats
path: root/hw/dma/i8257.c
diff options
context:
space:
mode:
authorMarc-André Lureau2016-07-13 02:11:59 +0200
committerMarc-André Lureau2016-09-08 16:05:21 +0200
commite305a16510afa74eec20390479e349402e55ef4c (patch)
treea7b169b1ea91349fb47db68c74e66d635a11e518 /hw/dma/i8257.c
parenttests: fix leak in test-string-input-visitor (diff)
downloadqemu-e305a16510afa74eec20390479e349402e55ef4c.tar.gz
qemu-e305a16510afa74eec20390479e349402e55ef4c.tar.xz
qemu-e305a16510afa74eec20390479e349402e55ef4c.zip
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/dma/i8257.c')
-rw-r--r--hw/dma/i8257.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/dma/i8257.c b/hw/dma/i8257.c
index f345c54762..bffbdea0ca 100644
--- a/hw/dma/i8257.c
+++ b/hw/dma/i8257.c
@@ -553,10 +553,12 @@ static void i8257_realize(DeviceState *dev, Error **errp)
memory_region_add_subregion(isa_address_space_io(isa),
d->base, &d->channel_io);
- isa_register_portio_list(isa, d->page_base, page_portio_list, d,
+ isa_register_portio_list(isa, &d->portio_page,
+ d->page_base, page_portio_list, d,
"dma-page");
if (d->pageh_base >= 0) {
- isa_register_portio_list(isa, d->pageh_base, pageh_portio_list, d,
+ isa_register_portio_list(isa, &d->portio_pageh,
+ d->pageh_base, pageh_portio_list, d,
"dma-pageh");
}