public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Chiang <achiang@hp.com>
To: Alex Riesen <raa.lkml@gmail.com>
Cc: lenb@kernel.org, twmoure@szypr.net, alessandro.suardi@gmail.com,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Thomas Renninger <trenn@suse.de>,
	linux-pci@vger.kernel.org
Subject: Re: [PATCH v3 11/12] ACPI: video: convert to acpi_get_pci_dev
Date: Thu, 25 Jun 2009 17:05:35 -0600	[thread overview]
Message-ID: <20090625230535.GE1723@ldl.fc.hp.com> (raw)
In-Reply-To: <81b0412b0906251538j2614bf91ya2edbaf120796dfc@mail.gmail.com>

Hi Alex,

Thanks for the bug report and sorry for the troubles.

I've already got a debug patch here:

	http://thread.gmane.org/gmane.linux.kernel/857228/focus=857468

Perhaps you can try it too?

Len, in the mean time, can you please apply this as an emergency,
"let's not crash anyone else's machine" while I try and figure
out why the ACPI video driver breaks my assumptions?

Troy, I applied your S-o-B, but maybe that was not a good
assumption on my part? To be sure, could you please respond with
your S-o-B?

Thanks.

/ac, wearing a brown paper bag

From: Troy Moure <twmoure@szypr.net>

ACPI: prevent NULL deref in acpi_get_pci_dev()

When the ACPI video driver initializes, it does a namespace walk
looking for for supported devices. When we find an appropriate
handle, we walk up the ACPI tree looking for a PCI root bus, and
then walk back down the PCI bus, assuming that every device
inbetween is a P2P bridge.

This assumption is not correct, and is reported broken on at
least:

	Dell Latitude E6400
	ThinkPad X61
	Dell XPS M1330

Add a NULL deref check to prevent boot panics.

Reported-by: Alessandro Suardi <alessandro.suardi@gmail.com>
Signed-off-by: Troy Moure <twmoure@szypr.net>
Signed-off-by: Alex Chiang <achiang@hp.com>
---
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index 8a5bf3b..55b5b90 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -395,7 +395,7 @@ struct pci_dev *acpi_get_pci_dev(acpi_handle handle)
 		fn  = adr & 0xffff;

 		pdev = pci_get_slot(pbus, PCI_DEVFN(dev, fn));
-		if (hnd == handle)
+		if (!pdev || hnd == handle)
 			break;

 		pbus = pdev->subordinate;

  reply	other threads:[~2009-06-25 23:05 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-10 19:55 [PATCH v3 00/12] Dynamic ACPI-PCI binding Alex Chiang
2009-06-10 19:55 ` [PATCH v3 01/12] ACPI: make acpi_pci_bind() static Alex Chiang
2009-06-10 19:55 ` [PATCH v3 02/12] ACPI: Introduce acpi_is_root_bridge() Alex Chiang
2009-06-10 19:55 ` [PATCH v3 03/12] ACPI: Introduce acpi_get_pci_dev() Alex Chiang
2009-06-10 19:55 ` [PATCH v3 04/12] ACPI: rearrange acpi_pci_bind/acpi_pci_unbind in pci_bind.c Alex Chiang
2009-06-10 19:55 ` [PATCH v3 05/12] ACPI: eviscerate pci_bind.c Alex Chiang
2009-06-10 19:55 ` [PATCH v3 06/12] ACPI: simplify acpi_pci_irq_add_prt() API Alex Chiang
2009-06-10 19:55 ` [PATCH v3 07/12] ACPI: simplify acpi_pci_irq_del_prt() API Alex Chiang
2009-06-10 19:55 ` [PATCH v3 08/12] ACPI: acpi_pci_unbind should clean up properly after acpi_pci_bind Alex Chiang
2009-06-10 19:55 ` [PATCH v3 09/12] PCI Hotplug: acpiphp: convert to acpi_get_pci_dev Alex Chiang
2009-06-10 19:55 ` [PATCH v3 10/12] ACPI: kill acpi_get_pci_id Alex Chiang
2009-06-10 19:56 ` [PATCH v3 11/12] ACPI: video: convert to acpi_get_pci_dev Alex Chiang
2009-06-25 22:38   ` Alex Riesen
2009-06-25 23:05     ` Alex Chiang [this message]
2009-06-26  6:43       ` Troy Moure
2009-06-26 10:56       ` Alex Riesen
2009-06-26 12:28         ` Alex Riesen
2009-06-26 19:19           ` Jesse Barnes
2009-06-26 19:28             ` Alex Chiang
2009-06-10 19:56 ` [PATCH v3 12/12] ACPI: kill acpi_get_physical_pci_device() Alex Chiang
2009-06-11 19:22 ` [PATCH v3 00/12] Dynamic ACPI-PCI binding Bjorn Helgaas
2009-06-18  3:36   ` Len Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090625230535.GE1723@ldl.fc.hp.com \
    --to=achiang@hp.com \
    --cc=alessandro.suardi@gmail.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=raa.lkml@gmail.com \
    --cc=trenn@suse.de \
    --cc=twmoure@szypr.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox