From b76e5e93982f28666aeef1055264f5eac76311b0 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Fri, 7 Dec 2007 17:55:51 +1100 Subject: [PATCH] [POWERPC] EEH: Avoid a possible NULL pointer dereference Signed-off-by: Stephen Rothwell Signed-off-by: Paul Mackerras --- arch/powerpc/platforms/pseries/eeh_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/pseries/eeh_driver.c b/arch/powerpc/platforms/pseries/eeh_driver.c index 06b89b56d0e9..68ea5eee39a8 100644 --- a/arch/powerpc/platforms/pseries/eeh_driver.c +++ b/arch/powerpc/platforms/pseries/eeh_driver.c @@ -310,8 +310,6 @@ struct pci_dn * handle_eeh_events (struct eeh_event *event) const char *location, *pci_str, *drv_str; frozen_dn = find_device_pe(event->dn); - frozen_bus = pcibios_find_pci_bus(frozen_dn); - if (!frozen_dn) { location = of_get_property(event->dn, "ibm,loc-code", NULL); @@ -321,6 +319,8 @@ struct pci_dn * handle_eeh_events (struct eeh_event *event) location, pci_name(event->dev)); return NULL; } + + frozen_bus = pcibios_find_pci_bus(frozen_dn); location = of_get_property(frozen_dn, "ibm,loc-code", NULL); location = location ? location : "unknown";