diff options
| author | Marc-André Lureau | 2016-07-13 02:11:59 +0200 |
|---|---|---|
| committer | Marc-André Lureau | 2016-09-08 16:05:21 +0200 |
| commit | e305a16510afa74eec20390479e349402e55ef4c (patch) | |
| tree | a7b169b1ea91349fb47db68c74e66d635a11e518 /hw/block | |
| parent | tests: fix leak in test-string-input-visitor (diff) | |
| download | qemu-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/block')
| -rw-r--r-- | hw/block/fdc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/block/fdc.c b/hw/block/fdc.c index f73af7db46..b79873af27 100644 --- a/hw/block/fdc.c +++ b/hw/block/fdc.c @@ -692,6 +692,7 @@ struct FDCtrl { /* Timers state */ uint8_t timer0; uint8_t timer1; + PortioList portio_list; }; static FloppyDriveType get_fallback_drive_type(FDrive *drv) @@ -2495,7 +2496,8 @@ static void isabus_fdc_realize(DeviceState *dev, Error **errp) FDCtrl *fdctrl = &isa->state; Error *err = NULL; - isa_register_portio_list(isadev, isa->iobase, fdc_portio_list, fdctrl, + isa_register_portio_list(isadev, &fdctrl->portio_list, + isa->iobase, fdc_portio_list, fdctrl, "fdc"); isa_init_irq(isadev, &fdctrl->irq, isa->irq); |
