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 b65e1e6..81b54f8 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;