From: Kevin.xie Date: Tue, 21 Feb 2023 03:18:51 +0000 (+0800) Subject: drivers: pci: Fix crash in rt-linux because of an uninitialized lock. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9edf6749fde8ff981e4b4547d97e70163963d128;p=platform%2Fkernel%2Flinux-starfive.git drivers: pci: Fix crash in rt-linux because of an uninitialized lock. Adjust the order of invocations in probe to avoid from the crash. Signed-off-by: Kevin.xie --- diff --git a/drivers/pci/controller/pcie-plda.c b/drivers/pci/controller/pcie-plda.c index 8fb1cb6..4013856 100644 --- a/drivers/pci/controller/pcie-plda.c +++ b/drivers/pci/controller/pcie-plda.c @@ -983,12 +983,6 @@ static int plda_pcie_probe(struct platform_device *pdev) if (plda_pcie_is_link_up(pcie) == PLDA_LINK_DOWN) goto release; - ret = pci_host_probe(bridge); - if (ret < 0) { - dev_err(&pdev->dev, "Failed to pci host probe: %d\n", ret); - goto release; - } - if (IS_ENABLED(CONFIG_PCI_MSI)) { ret = plda_pcie_enable_msi(pcie, bus); if (ret < 0) { @@ -997,6 +991,12 @@ static int plda_pcie_probe(struct platform_device *pdev) } } + ret = pci_host_probe(bridge); + if (ret < 0) { + dev_err(&pdev->dev, "Failed to pci host probe: %d\n", ret); + goto release; + } + exit: return ret;