From: Kenji Kaneshige Date: Sat, 3 Sep 2005 04:34:32 +0000 (-0400) Subject: [ACPI] fix run-time error checking in acpi_pci_irq_disable() X-Git-Tag: v2.6.14-rc1~256^2~14^2~7 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f0110f2a716376f3b260703835f527ca8900946;p=linux-2.6 [ACPI] fix run-time error checking in acpi_pci_irq_disable() The 'bus' field in pci_dev structure should be checked before calling pci_read_config_byte() because pci_bus_read_config_byte() called by pci_read_config_byte() refers to 'bus' field. Signed-off-by: Kenji Kaneshige Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c index 2bbfba8e8c..09567c2edc 100644 --- a/drivers/acpi/pci_irq.c +++ b/drivers/acpi/pci_irq.c @@ -500,7 +500,7 @@ void acpi_pci_irq_disable(struct pci_dev *dev) ACPI_FUNCTION_TRACE("acpi_pci_irq_disable"); - if (!dev) + if (!dev || !dev->bus) return_VOID; pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); @@ -508,9 +508,6 @@ void acpi_pci_irq_disable(struct pci_dev *dev) return_VOID; pin--; - if (!dev->bus) - return_VOID; - /* * First we check the PCI IRQ routing table (PRT) for an IRQ. */