public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] acpi: pci_root: fix NULL pointer deref after resume from suspend
@ 2009-09-28  6:31 Xiaotian Feng
  2009-09-28 17:38 ` Alex Chiang
  0 siblings, 1 reply; 22+ messages in thread
From: Xiaotian Feng @ 2009-09-28  6:31 UTC (permalink / raw)
  To: lenb, bjorn.helgaas, achiang, andrew.patterson, jbarnes
  Cc: linux-acpi, linux-kernel, Xiaotian Feng

commit 275582 introduces acpi_get_pci_dev(), but pdev->subordinate
can be NULL, then a NULL was passed to pci_get_slot, this results
the kernel oops when resume from suspend.

This patch resolves following kernel oops:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000028
IP: [<ffffffff812217e7>] pci_get_slot+0x4c/0x8c

Signed-off-by: Xiaotian Feng <dfeng@redhat.com>
---
 drivers/acpi/pci_root.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index 3112221..3c35144 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -387,7 +387,11 @@ struct pci_dev *acpi_get_pci_dev(acpi_handle handle)
 		if (!pdev || hnd == handle)
 			break;
 
-		pbus = pdev->subordinate;
+		if (pdev->subordinate)
+			pbus = pdev->subordinate;
+		else
+			pbus = pdev->bus;
+
 		pci_dev_put(pdev);
 	}
 out:
-- 
1.6.2.5


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

end of thread, other threads:[~2009-10-12  3:07 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-28  6:31 [PATCH] acpi: pci_root: fix NULL pointer deref after resume from suspend Xiaotian Feng
2009-09-28 17:38 ` Alex Chiang
2009-09-28 20:43   ` Rafael J. Wysocki
2009-09-28 21:05     ` Rafael J. Wysocki
2009-09-28 22:20       ` Alex Chiang
2009-09-28 22:50         ` Rafael J. Wysocki
2009-09-29 10:11           ` Danny Feng
2009-09-29 20:08             ` Rafael J. Wysocki
2009-09-29 20:49               ` Alex Chiang
2009-09-29 23:31                 ` Rafael J. Wysocki
2009-09-29  1:44   ` Danny Feng
2009-09-29 20:12     ` Rafael J. Wysocki
2009-09-30  2:46       ` Danny Feng
2009-09-30 21:26         ` Rafael J. Wysocki
2009-10-01 20:05     ` Alex Chiang
2009-10-03 22:56       ` Rafael J. Wysocki
2009-10-09  1:17         ` Danny Feng
2009-10-09  2:26         ` Danny Feng
2009-10-09 21:46           ` Rafael J. Wysocki
2009-10-12  3:05             ` Danny Feng
2009-10-09  1:16       ` Danny Feng
2009-10-09  2:28       ` Danny Feng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox