We should use of_get_next_child() in the eeh_restore_bars()
routine to safely traverse the node's children.
Signed-off-by: Michael Ellerman <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/pseries/eeh.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/eeh.c 
b/arch/powerpc/platforms/pseries/eeh.c
index 7309caa..abe3de1 100644
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -841,11 +841,8 @@ void eeh_restore_bars(struct pci_dn *pdn)
        if ((pdn->eeh_mode & EEH_MODE_SUPPORTED) && !IS_BRIDGE(pdn->class_code))
                __restore_bars (pdn);
 
-       dn = pdn->node->child;
-       while (dn) {
+       for (dn = NULL; (dn = of_get_next_child(pdn->node, dn));)
                eeh_restore_bars (PCI_DN(dn));
-               dn = dn->sibling;
-       }
 }
 
 /**
-- 
1.5.2.rc1.1884.g59b20

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Reply via email to