Skip to content

Commit bb46188

Browse files
aikozbenh
authored andcommitted
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>
1 parent d6dc246 commit bb46188

File tree

1 file changed

+2
-1
lines changed
  • arch/powerpc/platforms/pseries

1 file changed

+2
-1
lines changed

arch/powerpc/platforms/pseries/msi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ static struct device_node *find_pe_dn(struct pci_dev *dev, int *total)
220220

221221
/* Get the top level device in the PE */
222222
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);
224225
dn = eeh_dev_to_of_node(edev);
225226
if (!dn)
226227
return NULL;

0 commit comments

Comments
 (0)