Linux CXL
 help / color / mirror / Atom feed
* [PATCH 1/3] hw/mem/cxl_type3: Add paired msix_uninit_exclusive_bar() call
@ 2025-01-20  3:09 Li Zhijian
  2025-01-20  3:09 ` [PATCH 2/3] hw/mem/cxl_type3: Fix special_ops memory leak on msix_init_exclusive_bar() failure Li Zhijian
  2025-01-20  3:09 ` [PATCH 3/3] hw/mem/cxl_type3: Ensure errp is set on realization failure Li Zhijian
  0 siblings, 2 replies; 7+ messages in thread
From: Li Zhijian @ 2025-01-20  3:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jonathan Cameron, Fan Ni, linux-cxl, Li Zhijian

msix_uninit_exclusive_bar() should be paired with msix_init_exclusive_bar()

Ensure proper resource cleanup by adding the missing
`msix_uninit_exclusive_bar()` call for the Type3 CXL device.

Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
---
 hw/mem/cxl_type3.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/mem/cxl_type3.c b/hw/mem/cxl_type3.c
index f64af19ed6ae..9dad250f56d5 100644
--- a/hw/mem/cxl_type3.c
+++ b/hw/mem/cxl_type3.c
@@ -936,6 +936,7 @@ static void ct3_realize(PCIDevice *pci_dev, Error **errp)
 err_release_cdat:
     cxl_doe_cdat_release(cxl_cstate);
 err_free_special_ops:
+    msix_uninit_exclusive_bar(pci_dev);
     g_free(regs->special_ops);
 err_address_space_free:
     if (ct3d->dc.host_dc) {
@@ -959,6 +960,7 @@ static void ct3_exit(PCIDevice *pci_dev)
 
     pcie_aer_exit(pci_dev);
     cxl_doe_cdat_release(cxl_cstate);
+    msix_uninit_exclusive_bar(pci_dev);
     g_free(regs->special_ops);
     if (ct3d->dc.host_dc) {
         cxl_destroy_dc_regions(ct3d);
-- 
2.47.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-01-22  0:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-20  3:09 [PATCH 1/3] hw/mem/cxl_type3: Add paired msix_uninit_exclusive_bar() call Li Zhijian
2025-01-20  3:09 ` [PATCH 2/3] hw/mem/cxl_type3: Fix special_ops memory leak on msix_init_exclusive_bar() failure Li Zhijian
2025-01-21 14:58   ` Jonathan Cameron
2025-01-21 15:19     ` Jonathan Cameron
2025-01-22  0:56       ` Zhijian Li (Fujitsu)
2025-01-20  3:09 ` [PATCH 3/3] hw/mem/cxl_type3: Ensure errp is set on realization failure Li Zhijian
2025-01-21 14:59   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox