]> err.no Git - linux-2.6/commitdiff
[ACPI] fix run-time error checking in acpi_pci_irq_disable()
authorKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Sat, 3 Sep 2005 04:34:32 +0000 (00:34 -0400)
committerLen Brown <len.brown@intel.com>
Sat, 3 Sep 2005 04:36:26 +0000 (00:36 -0400)
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 <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/pci_irq.c

index 2bbfba8e8c6d01bf1cffd23a80afdf98caef7341..09567c2edcfb5225a67deb44d71cba7249915735 100644 (file)
@@ -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.
         */