From: linas Date: Fri, 2 Dec 2005 00:42:32 +0000 (-0600) Subject: [PATCH] powerpc/pseries: dlpar-add crash on null pointer deref X-Git-Tag: v2.6.16-rc1~473^2~4 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f17574a651884c721e1a33051719e59deb13c18;p=linux-2.6 [PATCH] powerpc/pseries: dlpar-add crash on null pointer deref This fixes a crash on null-pointer deref during dlpar slot addition. Signed-off-by: Linas Vepstas Signed-off-by: Paul Mackerras (cherry picked from 1c87c0f84943fbbc91826967ff4fea1b059a526f commit) --- diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c index 136365c1f8..17cea7f2af 100644 --- a/arch/powerpc/platforms/pseries/eeh.c +++ b/arch/powerpc/platforms/pseries/eeh.c @@ -698,7 +698,7 @@ static void *early_enable_eeh(struct device_node *dn, void *data) int enable; struct pci_dn *pdn = PCI_DN(dn); - pdn->class_code = *class_code; + pdn->class_code = 0; pdn->eeh_mode = 0; pdn->eeh_check_count = 0; pdn->eeh_freeze_count = 0; @@ -715,6 +715,7 @@ static void *early_enable_eeh(struct device_node *dn, void *data) pdn->eeh_mode |= EEH_MODE_NOCHECK; return NULL; } + pdn->class_code = *class_code; /* * Now decide if we are going to "Disable" EEH checking