From: Fabiano Rosas <farosas@suse.de>
To: qemu-devel@nongnu.org
Cc: "Denis V. Lunev" <den@openvz.org>, John Snow <jsnow@redhat.com>
Subject: [PATCH v2 1/3] ahci: Fix leak of IRQState
Date: Wed, 9 Sep 2026 19:14:07 -0300 [thread overview]
Message-ID: <20260909221409.291560-2-farosas@suse.de> (raw)
In-Reply-To: <20260909221409.291560-1-farosas@suse.de>
ASAN spotted an indirect leak in ahci-test:
Indirect leak of 576 byte(s) in 6 object(s) allocated from:
#0 0x556112a08ca0 in malloc
#1 0x7f21591e595d in g_malloc
#2 0x7f21591ffe38 in g_slice_alloc
#3 0x7f21591c988d in g_hash_table_new_full
#4 0x556114d756f1 in object_initialize_with_type ../qom/object.c:506:23
#5 0x556114d77590 in object_new_with_type ../qom/object.c:706:5
#6 0x556114d777e8 in object_new ../qom/object.c:722:12
#7 0x556114d6d2be in qemu_allocate_irq ../hw/core/irq.c:94:25
#8 0x556114d6d1bc in qemu_extend_irqs ../hw/core/irq.c:82:16
#9 0x556114d6d329 in qemu_allocate_irqs ../hw/core/irq.c:89:12
#10 0x5561135da9bd in ahci_realize ../hw/ide/ahci.c:1644:12
#11 0x55611360156a in pci_ich9_ahci_realize ../hw/ide/ich.c:132:5
Although ahci_realize() frees the return of qemu_allocate_irqs() right
away, the individual IRQStates are still left around.
Issue qemu_free_irq() at ahci_uninit().
Reviewed-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
---
hw/ide/ahci.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index 6b04762c4a..86f6297dc9 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -1688,6 +1688,7 @@ void ahci_uninit(AHCIState *s)
}
ide_exit(ide_state);
}
+ qemu_free_irq(ad->port.irq);
object_unparent(OBJECT(&ad->port));
}
--
2.53.0
next prev parent reply other threads:[~2026-09-09 22:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-09 22:14 [PATCH v2 0/3] A few leak fixes for QTest Fabiano Rosas
2026-09-09 22:14 ` Fabiano Rosas [this message]
2026-09-09 22:14 ` [PATCH v2 2/3] migration: Drop iochannel reference during snapshot setup Fabiano Rosas
2026-09-09 22:14 ` [PATCH v2 3/3] migration: Free the JSON writer during snapshots Fabiano Rosas
2026-09-10 12:24 ` Peter Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260909221409.291560-2-farosas@suse.de \
--to=farosas@suse.de \
--cc=den@openvz.org \
--cc=jsnow@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.