From: Zheng Huang <hz1624917200@gmail.com>
To: qemu-devel@nongnu.org
Subject: [PATCH] hw/ufs: free irq on exit
Date: Sat, 29 Mar 2025 19:47:19 +0800 [thread overview]
Message-ID: <43ceb427-87aa-44ee-9007-dbaecc499bba@gmail.com> (raw)
Hi,
This patch fixes a memory leak bug in `ufs_init_pci()`. `u->irq` is
not freed in `ufs_exit()`.
Signed-off-by: Zheng Huang <hz1624917200@gmail.com>
---
hw/ufs/ufs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/ufs/ufs.c b/hw/ufs/ufs.c
index 1ccd6f88b6..e80e065fea 100644
--- a/hw/ufs/ufs.c
+++ b/hw/ufs/ufs.c
@@ -25,6 +25,7 @@
#include "qapi/error.h"
#include "migration/vmstate.h"
#include "scsi/constants.h"
+#include "hw/irq.h"
#include "trace.h"
#include "ufs.h"
@@ -1732,6 +1733,8 @@ static void ufs_exit(PCIDevice *pci_dev)
{
UfsHc *u = UFS(pci_dev);
+ qemu_free_irq(u->irq);
+
qemu_bh_delete(u->doorbell_bh);
qemu_bh_delete(u->complete_bh);
--
2.34.1
next reply other threads:[~2025-03-29 11:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-29 11:47 Zheng Huang [this message]
2025-03-29 12:21 ` [PATCH] hw/ufs: free irq on exit Philippe Mathieu-Daudé
2025-03-31 11:20 ` Philippe Mathieu-Daudé
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=43ceb427-87aa-44ee-9007-dbaecc499bba@gmail.com \
--to=hz1624917200@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).