Skip to contentSkip to conversation

hw/ufs: free irq on exit

PATCH Applied Zheng Huang 2 participants 3 messages Mar 29, 2025 – Mar 31, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/ufs: free irq on exit

Hi,

This patch fixes a memory leak bug in ufs_init_pci(). u->irq is not freed in ufs_exit().

---
 hw/ufs/ufs.c | 3 +++
 1 file changed, 3 insertions(+)
hw/ufs/ufs.c +3 -0
index 1ccd6f88b6..e80e065fea 100644
@@ -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);
 
Signature · 1 line
2.34.1