]> git.sur5r.net Git - u-boot/commit
Fix computation in nand_util.c:get_len_incl_bad
authorDaniel Hobi <daniel.hobi@schmid-telecom.ch>
Tue, 1 Dec 2009 13:05:55 +0000 (14:05 +0100)
committerWolfgang Denk <wd@denx.de>
Mon, 7 Dec 2009 21:38:16 +0000 (22:38 +0100)
commit0ec81db20294efdad2454a753e79f1fe244a43ca
tree865172014f4b0dff001d4f7dfedf52cfef27f80e
parentaabb8cb0818e285aeed0cfaf243635997e07554d
Fix computation in nand_util.c:get_len_incl_bad

Depending on offset, flash size and the number of bad blocks,
get_len_incl_bad may return a too small value which may lead to:

1) If there are no bad blocks, nand_{read,write}_skip_bad chooses the
bad block aware read/write code. This may hurt performance, but does
not have any adverse effects.

2) If there are bad blocks, the nand_{read,write}_skip_bad may choose
the bad block unaware read/write code (if len_incl_bad == *length)
which leads to corrupted data.

Signed-off-by: Daniel Hobi <daniel.hobi@schmid-telecom.ch>
drivers/mtd/nand/nand_util.c