47 lines
1.4 KiB
Diff
47 lines
1.4 KiB
Diff
|
|
From 3746a434596b9bc20994c869c79fb9db24227418 Mon Sep 17 00:00:00 2001
|
||
|
|
From: qihao_yewu <qihao_yewu@cmss.chinamobile.com>
|
||
|
|
Date: Mon, 7 Apr 2025 13:56:18 -0400
|
||
|
|
Subject: [PATCH] hw/sd/sdhci: free irq on exit
|
||
|
|
MIME-Version: 1.0
|
||
|
|
Content-Type: text/plain; charset=UTF-8
|
||
|
|
Content-Transfer-Encoding: 8bit
|
||
|
|
|
||
|
|
cheery-pick from 1c2d03bb0889b7a9a677d53126fb035190683af4
|
||
|
|
|
||
|
|
Fix a memory leak bug in sdhci_pci_realize() due to s->irq
|
||
|
|
not being freed in sdhci_pci_exit().
|
||
|
|
|
||
|
|
Signed-off-by: Zheng Huang <hz1624917200@gmail.com>
|
||
|
|
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
|
||
|
|
Message-ID: <09ddf42b-a6db-42d5-954b-148d09d8d6cc@gmail.com>
|
||
|
|
[PMD: Moved qemu_free_irq() call before sdhci_common_unrealize()]
|
||
|
|
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
|
||
|
|
Signed-off-by: qihao_yewu <qihao_yewu@cmss.chinamobile.com>
|
||
|
|
---
|
||
|
|
hw/sd/sdhci-pci.c | 2 ++
|
||
|
|
1 file changed, 2 insertions(+)
|
||
|
|
|
||
|
|
diff --git a/hw/sd/sdhci-pci.c b/hw/sd/sdhci-pci.c
|
||
|
|
index 9b7bee8b3f..c1eb67cf29 100644
|
||
|
|
--- a/hw/sd/sdhci-pci.c
|
||
|
|
+++ b/hw/sd/sdhci-pci.c
|
||
|
|
@@ -18,6 +18,7 @@
|
||
|
|
#include "qemu/osdep.h"
|
||
|
|
#include "qapi/error.h"
|
||
|
|
#include "qemu/module.h"
|
||
|
|
+#include "hw/irq.h"
|
||
|
|
#include "hw/qdev-properties.h"
|
||
|
|
#include "hw/sd/sdhci.h"
|
||
|
|
#include "sdhci-internal.h"
|
||
|
|
@@ -49,6 +50,7 @@ static void sdhci_pci_exit(PCIDevice *dev)
|
||
|
|
{
|
||
|
|
SDHCIState *s = PCI_SDHCI(dev);
|
||
|
|
|
||
|
|
+ qemu_free_irq(s->irq);
|
||
|
|
sdhci_common_unrealize(s);
|
||
|
|
sdhci_uninitfn(s);
|
||
|
|
}
|
||
|
|
--
|
||
|
|
2.41.0.windows.1
|
||
|
|
|