From 03a97550941d17c7d5b621afde5945bbc0da6546 Mon Sep 17 00:00:00 2001 From: Zhaoxiu Zeng Date: Tue, 12 Apr 2016 15:30:35 +0800 Subject: [PATCH] mtd: nand: s3c2410: fix bug in s3c2410_nand_correct_data() If there is only one bit difference in the ECC, the function should return 1. The result of "diff0 & ~(1< Signed-off-by: Boris Brezillon --- drivers/mtd/nand/s3c2410.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c index 9c9397b54b2c..86ffb73e1085 100644 --- a/drivers/mtd/nand/s3c2410.c +++ b/drivers/mtd/nand/s3c2410.c @@ -542,7 +542,8 @@ static int s3c2410_nand_correct_data(struct mtd_info *mtd, u_char *dat, diff0 |= (diff1 << 8); diff0 |= (diff2 << 16); - if ((diff0 & ~(1<