]> git.sur5r.net Git - u-boot/blobdiff - nand_spl/nand_boot_fsl_elbc.c
NAND boot: fix nand_load overlap issue
[u-boot] / nand_spl / nand_boot_fsl_elbc.c
index 0d0c44e1e366d3343b8b5e14bfbe6fbe122f8d20..7f14a6fe458c5dd93b4d88addac669817be63a24 100644 (file)
@@ -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));
        }
 }