]> git.kernelconcepts.de Git - karo-tx-uboot.git/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)
committerLothar Waßmann <LW@KARO-electronics.de>
Thu, 10 Sep 2015 09:29:46 +0000 (11:29 +0200)
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;