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: <20250419133058.162048-1-18255117159@163.com>
Date: Sat, 19 Apr 2025 21:30:58 +0800
From: Hans Zhang <18255117159@....com>
To: lpieralisi@...nel.org
Cc: kw@...ux.com,
	manivannan.sadhasivam@...aro.org,
	robh@...nel.org,
	bhelgaas@...gle.com,
	s-vadapalli@...com,
	thomas.richard@...tlin.com,
	linux-pci@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	rockswang7@...il.com,
	Hans Zhang <18255117159@....com>
Subject: [PATCH v2] PCI: cadence: Fix runtime atomic count underflow.

If the call to pci_host_probe() in cdns_pcie_host_setup()
fails, PM runtime count is decremented in the error path using
pm_runtime_put_sync().But the runtime count is not incremented by this
driver, but only by the callers (cdns_plat_pcie_probe/j721e_pcie_probe).
And the callers also decrement theruntime PM count in their error path.
So this leads to the below warning from the PM core:

runtime PM usage count underflow!

So fix it by getting rid of pm_runtime_put_sync() in the error path and
directly return the errno.

Fixes: 1b79c5284439 ("PCI: cadence: Add host driver for Cadence PCIe controller")

Signed-off-by: Hans Zhang <18255117159@....com>
---
 drivers/pci/controller/cadence/pcie-cadence-host.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/pci/controller/cadence/pcie-cadence-host.c b/drivers/pci/controller/cadence/pcie-cadence-host.c
index 8af95e9da7ce..741e10a575ec 100644
--- a/drivers/pci/controller/cadence/pcie-cadence-host.c
+++ b/drivers/pci/controller/cadence/pcie-cadence-host.c
@@ -570,14 +570,5 @@ int cdns_pcie_host_setup(struct cdns_pcie_rc *rc)
 	if (!bridge->ops)
 		bridge->ops = &cdns_pcie_host_ops;
 
-	ret = pci_host_probe(bridge);
-	if (ret < 0)
-		goto err_init;
-
-	return 0;
-
- err_init:
-	pm_runtime_put_sync(dev);
-
-	return ret;
+	return pci_host_probe(bridge);
 }

base-commit: a24588245776dafc227243a01bfbeb8a59bafba9
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ