[PATCH] powerpc: Extra sanity check in EEH code

STALE7358d

2 messages, 2 authors, 2006-06-23 · open the first message on its own page

[PATCH] powerpc: Extra sanity check in EEH code

From: Anton Blanchard <hidden>
Date: 2006-06-20 08:01:58

From: Nathan Lynch <redacted>

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 <redacted>
Signed-off-by: Anton Blanchard <redacted>
---

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;
 	}

Re: [PATCH] powerpc: Extra sanity check in EEH code

From: Linas Vepstas <hidden>
Date: 2006-06-23 15:14:11

As nominal maintainer of the EEH code, I'll add

Signed-off-by: Linas Vepstas <redacted>

On Tue, Jun 20, 2006 at 06:01:58PM +1000, Anton Blanchard wrote:
quoted hunk
From: Nathan Lynch <redacted>

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 <redacted>
Signed-off-by: Anton Blanchard <redacted>
---

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;
 	}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help