From: Alexey Kardashevskiy Date: Fri, 23 Nov 2012 02:25:39 +0000 (+1100) Subject: powerpc/pseries: Fix oops with MSIs when missing EEH PEs X-Git-Tag: v3.7-rc7~1^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bb4618823a3389086f157fafb2a0d97cade8d89f;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git powerpc/pseries: Fix oops with MSIs when missing EEH PEs The new EEH code introduced a small regression, if the EEH PEs are missin (which happens currently in qemu for example), it will deref a NULL pointer in the MSI code. Signed-off-by: Alexey Kardashevskiy Signed-off-by: Benjamin Herrenschmidt --- 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;