Skip to content

Commit 58746a5

Browse files
committed
Merge branch 'pci/controller/histb'
- Call phy_exit() to clean up if histb_pcie_probe() fails (Christophe JAILLET) * pci/controller/histb: PCI: histb: Fix an error handling path in histb_pcie_probe()
2 parents ba4751a + b36fb50 commit 58746a5

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

drivers/pci/controller/dwc/pcie-histb.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -409,16 +409,21 @@ static int histb_pcie_probe(struct platform_device *pdev)
409409
ret = histb_pcie_host_enable(pp);
410410
if (ret) {
411411
dev_err(dev, "failed to enable host\n");
412-
return ret;
412+
goto err_exit_phy;
413413
}
414414

415415
ret = dw_pcie_host_init(pp);
416416
if (ret) {
417417
dev_err(dev, "failed to initialize host\n");
418-
return ret;
418+
goto err_exit_phy;
419419
}
420420

421421
return 0;
422+
423+
err_exit_phy:
424+
phy_exit(hipcie->phy);
425+
426+
return ret;
422427
}
423428

424429
static void histb_pcie_remove(struct platform_device *pdev)
@@ -427,8 +432,7 @@ static void histb_pcie_remove(struct platform_device *pdev)
427432

428433
histb_pcie_host_disable(hipcie);
429434

430-
if (hipcie->phy)
431-
phy_exit(hipcie->phy);
435+
phy_exit(hipcie->phy);
432436
}
433437

434438
static const struct of_device_id histb_pcie_of_match[] = {

0 commit comments

Comments
 (0)