LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Anton Blanchard <anton@samba.org>
To: linuxppc-dev@ozlabs.org
Cc: paulus@samba.org
Subject: [PATCH] powerpc: Extra sanity check in EEH code
Date: Tue, 20 Jun 2006 18:01:58 +1000	[thread overview]
Message-ID: <20060620080158.GB30974@krispykreme> (raw)


From: Nathan Lynch <ntl@pobox.com>

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 <ntl@pobox.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
---

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

             reply	other threads:[~2006-06-20  8:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-20  8:01 Anton Blanchard [this message]
2006-06-23 15:13 ` [PATCH] powerpc: Extra sanity check in EEH code Linas Vepstas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060620080158.GB30974@krispykreme \
    --to=anton@samba.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox