When the data does not contain all 0xFF bytes, 'check_data_ff()' should return
1, not -EINVAL; Also, the caller ('process_eb()') should not add the PEB to the
"corrupted" list if there was a read error.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
ubi_dbg_print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 1,
ubi->peb_buf1, ubi->leb_size, 1);
mutex_unlock(&ubi->buf_mutex);
- return -EINVAL;
+ return 1;
}
/**
* have to check what is in the data area.
*/
err = check_data_ff(ubi, vidh, pnum);
- if (!err)
+
+ if (err < 0)
+ return err;
+ else if (!err)
/* This corruption is caused by a power cut */
err = add_to_list(si, pnum, ec, 1, &si->erase);
else