<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
From: Kenji Kaneshige &lt;kaneshige.kenji@jp.fujitsu.com&gt;

This patch fixes possible null pointer access 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 &lt;kaneshige.kenji@jp.fujitsu.com&gt;
Cc: Len Brown &lt;len.brown@intel.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
---

 drivers/acpi/pci_irq.c |    5 +----
 1 files changed, 1 insertion(+), 4 deletions(-)

diff -puN drivers/acpi/pci_irq.c~fix-possible-null-pointer-access-acpi_pci_irq_disable drivers/acpi/pci_irq.c
--- devel/drivers/acpi/pci_irq.c~fix-possible-null-pointer-access-acpi_pci_irq_disable	2005-08-06 15:34:05.000000000 -0700
+++ devel-akpm/drivers/acpi/pci_irq.c	2005-08-06 15:34:05.000000000 -0700
@@ -500,7 +500,7 @@ void acpi_pci_irq_disable(struct pci_dev
 
 	ACPI_FUNCTION_TRACE("acpi_pci_irq_disable");
 
-	if (!dev)
+	if (!dev || !dev-&gt;bus)
 		return_VOID;
 
 	pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &amp;pin);
@@ -508,9 +508,6 @@ void acpi_pci_irq_disable(struct pci_dev
 		return_VOID;
 	pin--;
 
-	if (!dev-&gt;bus)
-		return_VOID;
-
 	/*
 	 * First we check the PCI IRQ routing table (PRT) for an IRQ.
 	 */
_
</pre></body></html>