fix possible null pointer reference in acpi_pci_irq_enable
PATCH 1/1 fix possible null pointer reference in acpi_pci_irq_enable
Hi,
The following patch fixes possible null pointer reference in acpi_pci_irq_enable().
Thanks,
Kenji Kaneshige
acpi_pci_irq_enable() should check if dev->bus is NULL before calling pci_read_config_byte that refers it.
Signed-off-by Kenji Kaneshige <[email protected]>
---
linux-2.6.11-kanesige/drivers/acpi/pci_irq.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
drivers/acpi/pci_irq.c renamed from drivers/acpi/pci_irq.c~fix_acpi_pci_irq_enable +5 -5
@@ -395,6 +395,11 @@ acpi_pci_irq_enable (if (!dev)return_VALUE (-EINVAL ); +if (!dev->bus) { +ACPI_DEBUG_PRINT ((ACPI_DB_ERROR ,"Invalid (NULL) 'bus' field\n" )); +return_VALUE (-ENODEV ); + } +pci_read_config_byte (dev,PCI_INTERRUPT_PIN , &pin);if (!pin) {ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"No interrupt pin configured for device %s\n" ,pci_name (dev)));
@@ -402,11 +407,6 @@ acpi_pci_irq_enable ( } pin--; -if (!dev->bus) { -ACPI_DEBUG_PRINT ((ACPI_DB_ERROR ,"Invalid (NULL) 'bus' field\n" )); -return_VALUE (-ENODEV ); - } -/* * First we check the PCI IRQ routing table (PRT) for an IRQ. PRT * values override any BIOS-assigned IRQs set during boot.
_
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click