]> git.sur5r.net Git - u-boot/commitdiff
fdtdec: Fix possible infinite loop in fdtdec_get_pci_vendev()
authorBin Meng <bmeng.cn@gmail.com>
Thu, 20 Aug 2015 13:40:25 +0000 (06:40 -0700)
committerSimon Glass <sjg@chromium.org>
Wed, 26 Aug 2015 14:54:13 +0000 (07:54 -0700)
When there is no valid compatible string in current list,
we should advance to next one in the compatible string list.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
lib/fdtdec.c

index b65e1e6185550e4651ebce5ecb46d50cecccf791..81b54f88e88722eab0458d83fce8684072baaffc 100644 (file)
@@ -207,9 +207,8 @@ int fdtdec_get_pci_vendev(const void *blob, int node, u16 *vendor, u16 *device)
 
                                return 0;
                        }
-               } else {
-                       list += (len + 1);
                }
+               list += (len + 1);
        }
 
        return -ENOENT;