diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index d1ffca8b34eac51853c812a230cfd438862f8cff..30e97bcc4f88293ff902df937446d0983db6d4f3 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -773,7 +773,7 @@ int __init early_init_dt_scan_chosen_serial(void)
 	if (offset < 0)
 		return -ENODEV;
 
-	while (match->compatible) {
+	while (match->compatible[0]) {
 		unsigned long addr;
 		if (fdt_node_check_compatible(fdt, offset, match->compatible)) {
 			match++;