lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200607093134.6393-1-dinghao.liu@zju.edu.cn>
Date:   Sun,  7 Jun 2020 17:31:33 +0800
From:   Dinghao Liu <dinghao.liu@....edu.cn>
To:     dinghao.liu@....edu.cn, kjlu@....edu
Cc:     Marek Vasut <marek.vasut+renesas@...il.com>,
        Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>,
        Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
        Rob Herring <robh@...nel.org>,
        Bjorn Helgaas <bhelgaas@...gle.com>, linux-pci@...r.kernel.org,
        linux-renesas-soc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] [v2] PCI: rcar: Fix runtime PM imbalance on error

pm_runtime_get_sync() increments the runtime PM usage counter even
the call returns an error code. Thus a corresponding decrement is
needed on the error handling path to keep the counter balanced.

Signed-off-by: Dinghao Liu <dinghao.liu@....edu.cn>
---

Changelog:

v2: - Remove unnecessary 'err_pm_put' label.
      Refine commit message.
---
 drivers/pci/controller/pcie-rcar.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/pci/controller/pcie-rcar.c b/drivers/pci/controller/pcie-rcar.c
index 759c6542c5c8..f9595ab54bc4 100644
--- a/drivers/pci/controller/pcie-rcar.c
+++ b/drivers/pci/controller/pcie-rcar.c
@@ -1143,7 +1143,7 @@ static int rcar_pcie_probe(struct platform_device *pdev)
 	err = rcar_pcie_get_resources(pcie);
 	if (err < 0) {
 		dev_err(dev, "failed to request resources: %d\n", err);
-		goto err_pm_put;
+		goto err_pm_disable;
 	}
 
 	err = clk_prepare_enable(pcie->bus_clk);
@@ -1206,10 +1206,8 @@ static int rcar_pcie_probe(struct platform_device *pdev)
 	irq_dispose_mapping(pcie->msi.irq2);
 	irq_dispose_mapping(pcie->msi.irq1);
 
-err_pm_put:
-	pm_runtime_put(dev);
-
 err_pm_disable:
+	pm_runtime_put(dev);
 	pm_runtime_disable(dev);
 	pci_free_resource_list(&pcie->resources);
 
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ