Skip to contentSkip to conversation

pci-bridge/xio3130_upstream: Fix error handling

PATCH In review Jonathan Cameron via 1 participant 3 messages Feb 18, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 pci-bridge/xio3130_upstream: Fix error handling

Goto label is incorrect so msi cleanup would not occur if there is an error in the ssvid initialization.

---
Noticed whilst working on equivalent CXL upstream switch port.

 hw/pci-bridge/xio3130_upstream.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/pci-bridge/xio3130_upstream.c +1 -1
index 5cd3af4fbc..5ff46ef050 100644
@@ -75,7 +75,7 @@ static void xio3130_upstream_realize(PCIDevice *d, Error **errp)
                                XIO3130_SSVID_SVID, XIO3130_SSVID_SSID,
                                errp);
     if (rc < 0) {
-        goto err_bridge;
+        goto err_msi;
     }
 
     rc = pcie_cap_init(d, XIO3130_EXP_OFFSET, PCI_EXP_TYPE_UPSTREAM,
Signature · 1 line
2.32.0
#1 lore raw

PATCH 2/2 pci-bridge/xio3130_downstream: Fix error handling

Wrong goto label, so msi cleanup would not occur if there is an error in the ssvid initialization.

---
 hw/pci-bridge/xio3130_downstream.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/pci-bridge/xio3130_downstream.c +1 -1
index 04aae72cd6..080a6613fe 100644
@@ -84,7 +84,7 @@ static void xio3130_downstream_realize(PCIDevice *d, Error **errp)
                                XIO3130_SSVID_SVID, XIO3130_SSVID_SSID,
                                errp);
     if (rc < 0) {
-        goto err_bridge;
+        goto err_msi;
     }
 
     rc = pcie_cap_init(d, XIO3130_EXP_OFFSET, PCI_EXP_TYPE_DOWNSTREAM,
Signature · 1 line
2.32.0
#2 lore raw
In reply to Jonathan Cameron via
Quoted 4 lines · On Fri, 18 Feb 2022 10:23:02 +0000 Jonathan Cameron via…

Goto label is incorrect so msi cleanup would not occur if there is an error in the ssvid initialization.

+Cc: [email protected] Turns out you get a weird result if you miss a space in your git send-email command. Apologies to Michael for scrambling his email address as a result!

Quoted 19 lines

---
Noticed whilst working on equivalent CXL upstream switch port.

 hw/pci-bridge/xio3130_upstream.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/pci-bridge/xio3130_upstream.c +1 -1
index 5cd3af4fbc..5ff46ef050 100644
@@ -75,7 +75,7 @@ static void xio3130_upstream_realize(PCIDevice *d, Error **errp)
                                XIO3130_SSVID_SVID, XIO3130_SSVID_SSID,
                                errp);
     if (rc < 0) {
-        goto err_bridge;
+        goto err_msi;
     }
 
     rc = pcie_cap_init(d, XIO3130_EXP_OFFSET, PCI_EXP_TYPE_UPSTREAM,