Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 12c8eb98 authored by Baruch Siach's avatar Baruch Siach Committed by David Woodhouse
Browse files

mtd: fix callback return value check



Drivers may (and do) return negative errno values other than -1 from the
ecc.correct callback.

Signed-off-by: default avatarBaruch Siach <baruch@tkos.co.il>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 899611ee
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1223,7 +1223,7 @@ static int nand_read_subpage(struct mtd_info *mtd, struct nand_chip *chip, uint3
		int stat;

		stat = chip->ecc.correct(mtd, p, &chip->buffers->ecccode[i], &chip->buffers->ecccalc[i]);
		if (stat == -1)
		if (stat < 0)
			mtd->ecc_stats.failed++;
		else
			mtd->ecc_stats.corrected += stat;