riva_get_EDID_OF() uses its own hand-rolled loop to check a nodes
children for a property, this is not safe WRT refcounting, so fix it
to use of_get_next_child().

Signed-off-by: Michael Ellerman <[EMAIL PROTECTED]>
---
 drivers/video/riva/fbdev.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c
index 5c47968..07b6b2d 100644
--- a/drivers/video/riva/fbdev.c
+++ b/drivers/video/riva/fbdev.c
@@ -1759,7 +1759,10 @@ static int __devinit riva_get_EDID_OF(struct fb_info 
*info, struct pci_dev *pd)
 
        NVTRACE_ENTER();
        dp = pci_device_to_OF_node(pd);
-       for (; dp != NULL; dp = dp->child) {
+
+       for (dp = of_get_next_child(dp, NULL);
+            dp != NULL;
+            dp = of_get_next_child(dp, dp)) {
                disptype = of_get_property(dp, "display-type", NULL);
                if (disptype == NULL)
                        continue;
-- 
1.5.1.3.g7a33b

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

Reply via email to