]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
PCI: s32g: Skip Root Port removal during success
authorVincent Guittot <vincent.guittot@linaro.org>
Mon, 2 Feb 2026 15:10:50 +0000 (16:10 +0100)
committerManivannan Sadhasivam <mani@kernel.org>
Tue, 3 Feb 2026 12:56:27 +0000 (18:26 +0530)
Currently, s32g_pcie_parse_ports() exercises the 'err_port' path even
during the success case. This results in ports getting deleted after
successful parsing of Root Ports.

Hence, skip the removal of Root Ports during success.

Fixes: 5cbc7d3e316e ("PCI: s32g: Add NXP S32G PCIe controller driver (RC)")
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
[mani: reworded subject and description]
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Link: https://patch.msgid.link/20260202151050.1446165-1-vincent.guittot@linaro.org
drivers/pci/controller/dwc/pcie-nxp-s32g.c

index 47745749f75c364bbe7b35c94fee8dea52d74ce2..b3ec38099fa3869b2e81cb3b3870ea120544a96b 100644 (file)
@@ -282,12 +282,12 @@ static int s32g_pcie_parse_ports(struct device *dev, struct s32g_pcie *s32g_pp)
 
                ret = s32g_pcie_parse_port(s32g_pp, of_port);
                if (ret)
-                       goto err_port;
+                       break;
        }
 
-err_port:
-       list_for_each_entry_safe(port, tmp, &s32g_pp->ports, list)
-               list_del(&port->list);
+       if (ret)
+               list_for_each_entry_safe(port, tmp, &s32g_pp->ports, list)
+                       list_del(&port->list);
 
        return ret;
 }