]> err.no Git - linux-2.6/commitdiff
[PATCH] powerpc/pseries: dlpar-add crash on null pointer deref
authorlinas <linas@austin.ibm.com>
Fri, 2 Dec 2005 00:42:32 +0000 (18:42 -0600)
committerPaul Mackerras <paulus@samba.org>
Tue, 10 Jan 2006 04:32:54 +0000 (15:32 +1100)
This fixes a crash on null-pointer deref during dlpar slot addition.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
(cherry picked from 1c87c0f84943fbbc91826967ff4fea1b059a526f commit)

arch/powerpc/platforms/pseries/eeh.c

index 136365c1f8e1d11b5085d3b050372d55596fc784..17cea7f2afd3a5dca0e918474ff83ea40fb05d6e 100644 (file)
@@ -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