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 <Mingkai.hu@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
This commit is contained in:
Mingkai Hu 2009-07-30 17:56:51 +08:00 committed by Wolfgang Denk
parent 1fc1d9aed0
commit 269610f6ba
1 changed files with 1 additions and 1 deletions

View 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));
}
}