From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Rafael J. Wysocki" Subject: Re: [PATCH] ACPI / PCI: Fix NULL pointer dereference in acpi_get_pci_dev() Date: Tue, 6 Oct 2009 02:01:42 +0200 Message-ID: <200910060201.42519.rjw@sisk.pl> References: <200910060130.43246.rjw@sisk.pl> <20091005233759.GB14394@ldl.fc.hp.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20091005233759.GB14394@ldl.fc.hp.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-pm-bounces@lists.linux-foundation.org Errors-To: linux-pm-bounces@lists.linux-foundation.org To: Alex Chiang Cc: chepioq@gmail.com, Linux PCI , LKML , Jesse Barnes , ACPI Devel Maling List , Danny Feng , pm list List-Id: linux-pm@vger.kernel.org On Tuesday 06 October 2009, Alex Chiang wrote: > * Rafael J. Wysocki : > > > > Fixes http://bugzilla.kernel.org/show_bug.cgi?id=14129, which is a > > regression from 2.6.30. > > Thanks for doing this. > > One small comment below (not major), but other than that: > > Reviewed-by: Alex Chiang > > > Signed-off-by: Rafael J. Wysocki > > Reported-by: Danny Feng > > Tested-by: chepioq > > --- > > drivers/acpi/pci_root.c | 12 ++++++++++++ > > 1 file changed, 12 insertions(+) > > > > Index: linux-2.6/drivers/acpi/pci_root.c > > =================================================================== > > --- linux-2.6.orig/drivers/acpi/pci_root.c > > +++ linux-2.6/drivers/acpi/pci_root.c > > @@ -389,6 +389,18 @@ struct pci_dev *acpi_get_pci_dev(acpi_ha > > > > pbus = pdev->subordinate; > > pci_dev_put(pdev); > > + > > + /* > > + * During resume from a sleep state we can get a dock > > + * notification for a device that is present in ACPI tables, > > + * but not physically accessible at the moment, so tell the > > + * caller it's not present in that case. > > + */ > > + if (!pbus) { > > + dev_info(&pdev->dev, "Secondary bus not present\n"); > > Should this be dev_dbg() or maybe even strike it completely? I thought about that, but I decided not to just in order to get some idea about how many affected systems are out there. If that happens to be a problem for anyone, we can simply remove the message in the future. > > > + pdev = NULL; > > + break; > > + } > > } > > out: > > list_for_each_entry_safe(node, tmp, &device_list, node) > > Thanks, Rafael