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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2245131.irdbgypaU6@rafael.j.wysocki>
Date: Fri, 19 Sep 2025 18:38:42 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Linux PM <linux-pm@...r.kernel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
 Linux PCI <linux-pci@...r.kernel.org>,
 Alex Williamson <alex.williamson@...hat.com>,
 Bjorn Helgaas <helgaas@...nel.org>, Takashi Iwai <tiwai@...e.de>,
 Zhang Qilong <zhangqilong3@...wei.com>, Ulf Hansson <ulf.hansson@...aro.org>
Subject:
 [PATCH v1 2/3] PCI/sysfs: Use PM runtime class macro for auto cleanup in
 reset_method_store()

From: Takashi Iwai <tiwai@...e.de>

The newly introduced class macro can simplify the code.

Also, add the proper error handling for the PM runtime get.

Signed-off-by: Takashi Iwai <tiwai@...e.de>
[ rjw: Adjust subject and error handling ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
---
 drivers/pci/pci-sysfs.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -1475,8 +1475,9 @@ static ssize_t reset_method_store(struct
 		return count;
 	}
 
-	pm_runtime_get_sync(dev);
-	struct device *pmdev __free(pm_runtime_put) = dev;
+	CLASS(pm_runtime_resume_and_get, pmdev)(dev);
+	if (IS_ERR(pmdev))
+		return -ENXIO;
 
 	if (sysfs_streq(buf, "default")) {
 		pci_init_reset_methods(pdev);




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ