diff --git a/common/image-android-dt.c b/common/image-android-dt.c index c0683ee70f36eecd46d76c4df1c8fcfa0ffcfd74..691682617932ec4758bc93a1896d7f66d0b158ff 100644 --- a/common/image-android-dt.c +++ b/common/image-android-dt.c @@ -53,8 +53,8 @@ bool android_dt_get_fdt_by_index(ulong hdr_addr, u32 index, ulong *addr, entry_size = fdt32_to_cpu(hdr->dt_entry_size); unmap_sysmem(hdr); - if (index > entry_count) { - printf("Error: index > dt_entry_count (%u > %u)\n", index, + if (index >= entry_count) { + printf("Error: index >= dt_entry_count (%u >= %u)\n", index, entry_count); return false; }