From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 20 Jun 2006 18:01:58 +1000 From: Anton Blanchard To: linuxppc-dev@ozlabs.org Subject: [PATCH] powerpc: Extra sanity check in EEH code Message-ID: <20060620080158.GB30974@krispykreme> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: paulus@samba.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Nathan Lynch Don't dereference a device node that isn't there. A "shouldn't happen" case, but someone ran into it with a possibly misconfigured device tree. Signed-off-by: Nathan Lynch Signed-off-by: Anton Blanchard --- Index: build/arch/powerpc/platforms/pseries/eeh_cache.c =================================================================== --- build.orig/arch/powerpc/platforms/pseries/eeh_cache.c 2006-06-08 10:57:36.000000000 +1000 +++ build/arch/powerpc/platforms/pseries/eeh_cache.c 2006-06-20 12:01:49.000000000 +1000 @@ -304,6 +304,8 @@ void __init pci_addr_cache_build(void) pci_addr_cache_insert_device(dev); dn = pci_device_to_OF_node(dev); + if (!dn) + continue; pci_dev_get (dev); /* matching put is in eeh_remove_device() */ PCI_DN(dn)->pcidev = dev; }