mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
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>
This commit is contained in:
parent
bd794065ff
commit
e305a16510
11 changed files with 41 additions and 22 deletions
|
@ -39,6 +39,8 @@ typedef struct ISAVGAState {
|
|||
ISADevice parent_obj;
|
||||
|
||||
struct VGACommonState state;
|
||||
PortioList portio_vga;
|
||||
PortioList portio_vbe;
|
||||
} ISAVGAState;
|
||||
|
||||
static void vga_isa_reset(DeviceState *dev)
|
||||
|
@ -60,9 +62,11 @@ static void vga_isa_realizefn(DeviceState *dev, Error **errp)
|
|||
vga_common_init(s, OBJECT(dev), true);
|
||||
s->legacy_address_space = isa_address_space(isadev);
|
||||
vga_io_memory = vga_init_io(s, OBJECT(dev), &vga_ports, &vbe_ports);
|
||||
isa_register_portio_list(isadev, 0x3b0, vga_ports, s, "vga");
|
||||
isa_register_portio_list(isadev, &d->portio_vga,
|
||||
0x3b0, vga_ports, s, "vga");
|
||||
if (vbe_ports) {
|
||||
isa_register_portio_list(isadev, 0x1ce, vbe_ports, s, "vbe");
|
||||
isa_register_portio_list(isadev, &d->portio_vbe,
|
||||
0x1ce, vbe_ports, s, "vbe");
|
||||
}
|
||||
memory_region_add_subregion_overlap(isa_address_space(isadev),
|
||||
0x000a0000,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue