diff mbox series

hw/ufs: free irq on exit

Message ID 43ceb427-87aa-44ee-9007-dbaecc499bba@gmail.com (mailing list archive)
State New
Headers show
Series hw/ufs: free irq on exit | expand

Commit Message

Zheng Huang March 29, 2025, 11:47 a.m. UTC
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(+)

Comments

Philippe Mathieu-Daudé March 29, 2025, 12:21 p.m. UTC | #1
On 29/3/25 12:47, Zheng Huang wrote:
> 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(+)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Philippe Mathieu-Daudé March 31, 2025, 11:20 a.m. UTC | #2
On 29/3/25 12:47, Zheng Huang wrote:
> 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(+)

Queued to hw-misc, thanks!
diff mbox series

Patch

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);