diff options
author | Alexey Kardashevskiy <aik@ozlabs.ru> | 2012-11-22 21:25:39 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-11-22 21:26:05 -0500 |
commit | bb4618823a3389086f157fafb2a0d97cade8d89f (patch) | |
tree | 0485c5a67e6dd65dae4bf0a64122b20159b2aa51 | |
parent | d6dc24613c222f9057131ccbd5264a10bcba9f97 (diff) |
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 <aik@ozlabs.ru>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/platforms/pseries/msi.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c index d19f4977c834..e5b084723131 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) | |||
220 | 220 | ||
221 | /* Get the top level device in the PE */ | 221 | /* Get the top level device in the PE */ |
222 | edev = of_node_to_eeh_dev(dn); | 222 | edev = of_node_to_eeh_dev(dn); |
223 | edev = list_first_entry(&edev->pe->edevs, struct eeh_dev, list); | 223 | if (edev->pe) |
224 | edev = list_first_entry(&edev->pe->edevs, struct eeh_dev, list); | ||
224 | dn = eeh_dev_to_of_node(edev); | 225 | dn = eeh_dev_to_of_node(edev); |
225 | if (!dn) | 226 | if (!dn) |
226 | return NULL; | 227 | return NULL; |