Subject: [Fwd: [PATCH] From: Gavin Shan <[email-masked]>]

From: Benjamin Herrenschmidt <[email-masked]>
Date: Fri, 23 Nov 2012 13:22:53 +1100

Subject: [PATCH] From: Gavin Shan <[email-masked]>
From: Alexey Kardashevskiy <[email-masked]>
To: David Gibson <[email-masked]>
Cc: Alexey Kardashevskiy <[email-masked]>, Benjamin Herrenschmidt <[email-masked]>, Gavin Shan <[email-masked]>
Date: Thu, 22 Nov 2012 17:56:28 +1100

pseries msi: fixed crash on PCI devices without EEH capability

Signed-off-by: Alexey Kardashevskiy <[email-masked]>
---
 arch/powerpc/platforms/pseries/msi.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c
index d19f497..e5b0847 100644
--- a/arch/powerpc/platforms/pseries/msi.c
+++ b/arch/powerpc/platforms/pseries/msi.c
@@ -220,7 +220,8 @@ static struct device_node *find_pe_dn(struct pci_dev *dev, int *total)
 
 	/* Get the top level device in the PE */
 	edev = of_node_to_eeh_dev(dn);
-	edev = list_first_entry(&edev->pe->edevs, struct eeh_dev, list);
+	if (edev->pe)
+		edev = list_first_entry(&edev->pe->edevs, struct eeh_dev, list);
 	dn = eeh_dev_to_of_node(edev);
 	if (!dn)
 		return NULL;
-- 
1.7.10.4