linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI/ACPI: do not reference a pci device after it has been released
@ 2022-04-28 14:28 Greg Kroah-Hartman
  2022-04-28 15:58 ` Bjorn Helgaas
  0 siblings, 1 reply; 12+ messages in thread
From: Greg Kroah-Hartman @ 2022-04-28 14:28 UTC (permalink / raw)
  To: bhelgaas, rafael
  Cc: linux-kernel, Greg Kroah-Hartman, Len Brown, linux-pci,
	linux-acpi, whitehat002

In acpi_get_pci_dev(), the debugging message for when a PCI bridge is
not found uses a pointer to a pci device whose reference has just been
dropped.  The chance that this really is a device that is now been
removed from the system is almost impossible to happen, but to be safe,
let's print out the debugging message based on the acpi root device
which we do have a valid reference to at the moment.

Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Len Brown <lenb@kernel.org>
Cc: linux-pci@vger.kernel.org
Cc: linux-acpi@vger.kernel.org
Reported-by: whitehat002 <hackyzh002@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/acpi/pci_root.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index 6f9e75d14808..ecda378dbc09 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -303,7 +303,8 @@ struct pci_dev *acpi_get_pci_dev(acpi_handle handle)
 		 * case pdev->subordinate will be NULL for the parent.
 		 */
 		if (!pbus) {
-			dev_dbg(&pdev->dev, "Not a PCI-to-PCI bridge\n");
+			dev_dbg(&root->device->dev,
+				"dev %d, function %d is not a PCI-to-PCI bridge\n", dev, fn);
 			pdev = NULL;
 			break;
 		}
-- 
2.36.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-09-10 14:06 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-28 14:28 [PATCH] PCI/ACPI: do not reference a pci device after it has been released Greg Kroah-Hartman
2022-04-28 15:58 ` Bjorn Helgaas
2022-04-28 16:22   ` Greg Kroah-Hartman
2022-04-28 20:15     ` Rafael J. Wysocki
2022-04-28 20:30       ` Rafael J. Wysocki
2022-06-27 15:07         ` Greg Kroah-Hartman
2022-06-27 16:37           ` Rafael J. Wysocki
2022-09-09  7:42             ` Greg Kroah-Hartman
2022-09-09 21:18               ` Rafael J. Wysocki
2022-09-10  5:42                 ` Greg Kroah-Hartman
2022-09-10 13:33                   ` Rafael J. Wysocki
2022-09-10 14:06                     ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).