From 269610f6ba2e4a7bc27d2e53d43160614016964f Mon Sep 17 00:00:00 2001 From: Mingkai Hu Date: Thu, 30 Jul 2009 17:56:51 +0800 Subject: NAND boot: fix nand_load overlap issue The code copy data from NAND flash block by block, so when the data length isn't a whole-number multiple of the block size, it will overlap the rest space. Signed-off-by: Mingkai Hu Signed-off-by: Scott Wood --- nand_spl/nand_boot_fsl_elbc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nand_spl/nand_boot_fsl_elbc.c') 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)); } } -- cgit v1.2.1