mirror of
https://github.com/fail0verflow/mini.git
synced 2024-11-24 12:19:21 +01:00
don't try to correct ECC on uninitialized pages
This commit is contained in:
parent
5811742c07
commit
45b8895ac9
3
nand.c
3
nand.c
@ -263,7 +263,8 @@ int nand_correct(u32 pageno, void *data, void *ecc)
|
||||
|
||||
for(i=0;i<4;i++) {
|
||||
u32 syndrome = *ecc_read ^ *ecc_calc; //calculate ECC syncrome
|
||||
if(syndrome) {
|
||||
// don't try to correct unformatted pages (all FF)
|
||||
if ((*ecc_read != 0xFFFFFFFF) && syndrome) {
|
||||
if(!((syndrome-1)&syndrome)) {
|
||||
// single-bit error in ECC
|
||||
corrected++;
|
||||
|
Loading…
Reference in New Issue
Block a user