summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nand_spl/nand_boot_fsl_elbc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/nand_spl/nand_boot_fsl_elbc.c b/nand_spl/nand_boot_fsl_elbc.c
index 0d0c44e1e3..7f14a6fe45 100644
--- a/nand_spl/nand_boot_fsl_elbc.c
+++ b/nand_spl/nand_boot_fsl_elbc.c
@@ -120,7 +120,7 @@ static void nand_load(unsigned int offs, int uboot_size, uchar *dst)
pos += page_size;
offs += page_size;
- } while (offs & (block_size - 1));
+ } while ((offs & (block_size - 1)) && (pos < uboot_size));
}
}