Skip to content

Commit

Permalink
[ACPI] fix run-time error checking in acpi_pci_irq_disable()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kenji Kaneshige authored and Len Brown committed Sep 3, 2005
1 parent 8713cbe commit 5f0110f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/acpi/pci_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,17 +500,14 @@ 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);
if (!pin)
return_VOID;
pin--;

if (!dev->bus)
return_VOID;

/*
* First we check the PCI IRQ routing table (PRT) for an IRQ.
*/
Expand Down

0 comments on commit 5f0110f

Please sign in to comment.