diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2021-02-24 14:59:22 -0600 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2021-02-24 14:59:22 -0600 |
commit | 4842b3869e4a776547d165f698843d08d93f4e6a (patch) | |
tree | abe94f2ea562c3b693f5e49678c17b42d64a5ee4 /drivers/pci | |
parent | b994a66a9d989b43eff9dac586ac73b04279d196 (diff) | |
parent | 42814c438aac79746d310f413a27d5b0b959c5de (diff) | |
download | linux-4842b3869e4a776547d165f698843d08d93f4e6a.tar.bz2 |
Merge branch 'remotes/lorenzo/pci/mediatek'
- Fix of_node_put() reference leak (Krzysztof WilczyĆski)
* remotes/lorenzo/pci/mediatek:
PCI: mediatek: Add missing of_node_put() to fix reference leak
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/controller/pcie-mediatek.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/pci/controller/pcie-mediatek.c b/drivers/pci/controller/pcie-mediatek.c index cf4c18f0c25a..23548b517e4b 100644 --- a/drivers/pci/controller/pcie-mediatek.c +++ b/drivers/pci/controller/pcie-mediatek.c @@ -1035,14 +1035,14 @@ static int mtk_pcie_setup(struct mtk_pcie *pcie) err = of_pci_get_devfn(child); if (err < 0) { dev_err(dev, "failed to parse devfn: %d\n", err); - return err; + goto error_put_node; } slot = PCI_SLOT(err); err = mtk_pcie_parse_port(pcie, child, slot); if (err) - return err; + goto error_put_node; } err = mtk_pcie_subsys_powerup(pcie); @@ -1058,6 +1058,9 @@ static int mtk_pcie_setup(struct mtk_pcie *pcie) mtk_pcie_subsys_powerdown(pcie); return 0; +error_put_node: + of_node_put(child); + return err; } static int mtk_pcie_probe(struct platform_device *pdev) |