summaryrefslogtreecommitdiff
path: root/hw/char/parallel.c
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/char/parallel.c
parentbd794065ffffe10721b6a95f1db52f2cc7953196 (diff)
downloadqemu-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/char/parallel.c')
-rw-r--r--hw/char/parallel.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/char/parallel.c b/hw/char/parallel.c
index 11c78fed88..fa085667ff 100644
--- a/hw/char/parallel.c
+++ b/hw/char/parallel.c
@@ -80,6 +80,7 @@ typedef struct ParallelState {
uint32_t last_read_offset; /* For debugging */
/* Memory-mapped interface */
int it_shift;
+ PortioList portio_list;
} ParallelState;
#define TYPE_ISA_PARALLEL "isa-parallel"
@@ -532,7 +533,7 @@ static void parallel_isa_realizefn(DeviceState *dev, Error **errp)
s->status = dummy;
}
- isa_register_portio_list(isadev, base,
+ isa_register_portio_list(isadev, &s->portio_list, base,
(s->hw_driver
? &isa_parallel_portio_hw_list[0]
: &isa_parallel_portio_sw_list[0]),