Commit b76e5e93 authored by Stephen Rothwell's avatar Stephen Rothwell Committed by Paul Mackerras

[POWERPC] EEH: Avoid a possible NULL pointer dereference

Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 1dee2026
...@@ -310,8 +310,6 @@ struct pci_dn * handle_eeh_events (struct eeh_event *event) ...@@ -310,8 +310,6 @@ struct pci_dn * handle_eeh_events (struct eeh_event *event)
const char *location, *pci_str, *drv_str; const char *location, *pci_str, *drv_str;
frozen_dn = find_device_pe(event->dn); frozen_dn = find_device_pe(event->dn);
frozen_bus = pcibios_find_pci_bus(frozen_dn);
if (!frozen_dn) { if (!frozen_dn) {
location = of_get_property(event->dn, "ibm,loc-code", NULL); location = of_get_property(event->dn, "ibm,loc-code", NULL);
...@@ -321,6 +319,8 @@ struct pci_dn * handle_eeh_events (struct eeh_event *event) ...@@ -321,6 +319,8 @@ struct pci_dn * handle_eeh_events (struct eeh_event *event)
location, pci_name(event->dev)); location, pci_name(event->dev));
return NULL; return NULL;
} }
frozen_bus = pcibios_find_pci_bus(frozen_dn);
location = of_get_property(frozen_dn, "ibm,loc-code", NULL); location = of_get_property(frozen_dn, "ibm,loc-code", NULL);
location = location ? location : "unknown"; location = location ? location : "unknown";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment