From: Kyungmin Park Date: Tue, 2 Feb 2010 04:44:56 +0000 (+0900) Subject: OneNAND: Don't write if it exceeds the partition X-Git-Tag: JB02_20100203~11^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2ce10476e35556875d8227c0cf753b7b1726ea4b;p=kernel%2Fu-boot.git OneNAND: Don't write if it exceeds the partition Signed-off-by: Kyungmin Park --- diff --git a/common/cmd_onenand.c b/common/cmd_onenand.c index 8b0741a..bf76610 100644 --- a/common/cmd_onenand.c +++ b/common/cmd_onenand.c @@ -86,7 +86,6 @@ static int onenand_block_read(loff_t from, ssize_t len, printk("Bad blocks %d at 0x%x\n", (u32)(ofs >> this->erase_shift), (u32)ofs); ofs += blocksize; - /* FIXME need to check how to handle the 'len' */ len -= blocksize; continue; } @@ -146,6 +145,7 @@ static int onenand_block_write(loff_t to, ssize_t len, printk("Bad blocks %d at 0x%x\n", (u32)(ofs >> this->erase_shift), (u32)ofs); skip_ofs += blocksize; + len -= blocksize; goto next; }