From patchwork Mon Oct 5 23:30:43 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafael Wysocki X-Patchwork-Id: 51833 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n95Naob0025605 for ; Mon, 5 Oct 2009 23:36:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754807AbZJEXaD (ORCPT ); Mon, 5 Oct 2009 19:30:03 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754941AbZJEXaD (ORCPT ); Mon, 5 Oct 2009 19:30:03 -0400 Received: from ogre.sisk.pl ([217.79.144.158]:49454 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754807AbZJEXaB (ORCPT ); Mon, 5 Oct 2009 19:30:01 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by ogre.sisk.pl (Postfix) with ESMTP id 3132A15C8D1; Tue, 6 Oct 2009 01:29:01 +0200 (CEST) Received: from ogre.sisk.pl ([127.0.0.1]) by localhost (ogre.sisk.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 16769-04; Tue, 6 Oct 2009 01:28:36 +0200 (CEST) Received: from tosh.localnet (220-bem-13.acn.waw.pl [82.210.184.220]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ogre.sisk.pl (Postfix) with ESMTP id CCD5415C8CC; Tue, 6 Oct 2009 01:28:36 +0200 (CEST) From: "Rafael J. Wysocki" To: Len Brown Subject: [PATCH] ACPI / PCI: Fix NULL pointer dereference in acpi_get_pci_dev() Date: Tue, 6 Oct 2009 01:30:43 +0200 User-Agent: KMail/1.12.1 (Linux/2.6.32-rc2-rjw; KDE/4.3.1; x86_64; ; ) Cc: LKML , ACPI Devel Maling List , pm list , Alex Chiang , Danny Feng , Jesse Barnes , Linux PCI , chepioq@gmail.com MIME-Version: 1.0 Message-Id: <200910060130.43246.rjw@sisk.pl> X-Virus-Scanned: amavisd-new at ogre.sisk.pl using MkS_Vir for Linux Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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"); + pdev = NULL; + break; + } } out: list_for_each_entry_safe(node, tmp, &device_list, node)