lkml.org 
[lkml]   [2023]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] PCI: kirin: Fix an error path in kirin_pcie_probe()
Date
If an error occurs after a successful kirin_pcie_power_on(),
kirin_pcie_power_off() should be called, as already done in the remove
function.

Fixes: fc5165db245a ("PCI: kirin: Add HiSilicon Kirin SoC PCIe controller driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Not sure of the Fixes tag.
---
drivers/pci/controller/dwc/pcie-kirin.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/controller/dwc/pcie-kirin.c b/drivers/pci/controller/dwc/pcie-kirin.c
index 2ee146767971..0b93de9d2d06 100644
--- a/drivers/pci/controller/dwc/pcie-kirin.c
+++ b/drivers/pci/controller/dwc/pcie-kirin.c
@@ -813,7 +813,15 @@ static int kirin_pcie_probe(struct platform_device *pdev)
if (ret)
return ret;

- return dw_pcie_host_init(&pci->pp);
+ ret = dw_pcie_host_init(&pci->pp);
+ if (ret)
+ goto err_power_off;
+
+ return 0;
+
+err_power_off:
+ kirin_pcie_power_off(kirin_pcie);
+ return ret;
}

static struct platform_driver kirin_pcie_driver = {
--
2.34.1
\
 
 \ /
  Last update: 2023-10-30 09:21    [W:0.081 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site