summaryrefslogtreecommitdiff
path: root/drivers/mtd/tests/nandbiterrs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/tests/nandbiterrs.c')
-rw-r--r--drivers/mtd/tests/nandbiterrs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/tests/nandbiterrs.c b/drivers/mtd/tests/nandbiterrs.c
index 5f03b8c885a9..cde19c99e77b 100644
--- a/drivers/mtd/tests/nandbiterrs.c
+++ b/drivers/mtd/tests/nandbiterrs.c
@@ -151,7 +151,7 @@ static int read_page(int log)
memcpy(&oldstats, &mtd->ecc_stats, sizeof(oldstats));
err = mtd_read(mtd, offset, mtd->writesize, &read, rbuffer);
- if (err == -EUCLEAN)
+ if (!err || err == -EUCLEAN)
err = mtd->ecc_stats.corrected - oldstats.corrected;
if (err < 0 || read != mtd->writesize) {