[U-Boot] [PATCH v2 09/12] fdtdec: Fix possible infinite loop in fdtdec_get_pci_vendev()

Bin Meng bmeng.cn at gmail.com
Thu Aug 20 15:40:25 CEST 2015


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 at gmail.com>
---

Changes in v2: None

 lib/fdtdec.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index d21fb74..39268a2 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -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;
-- 
1.8.2.1



More information about the U-Boot mailing list