2014-02-01 18:10:40

by Boris BREZILLON

[permalink] [raw]
Subject: [PATCH] mtd: nand: fix erronous read_buf call in nand_write_page_raw_syndrome

read_buf is called in place of write_buf in the
nand_write_page_raw_syndrome function.

Signed-off-by: Boris BREZILLON <[email protected]>
---
drivers/mtd/nand/nand_base.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 15069ec..f59a465 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -1902,7 +1902,7 @@ static int nand_write_page_raw_syndrome(struct mtd_info *mtd,
oob += chip->ecc.prepad;
}

- chip->read_buf(mtd, oob, eccbytes);
+ chip->write_buf(mtd, oob, eccbytes);
oob += eccbytes;

if (chip->ecc.postpad) {
--
1.7.9.5


2014-02-11 18:44:33

by Brian Norris

[permalink] [raw]
Subject: Re: [PATCH] mtd: nand: fix erronous read_buf call in nand_write_page_raw_syndrome

On Sat, Feb 01, 2014 at 07:10:28PM +0100, Boris BREZILLON wrote:
> read_buf is called in place of write_buf in the
> nand_write_page_raw_syndrome function.
>
> Signed-off-by: Boris BREZILLON <[email protected]>

Good catch! I guess no one really tests this function. I can understand
that, since it's in the "raw" version (i.e., without ECC), which should
really only be used for special debugging purposes. And many drivers
don't use the defaults for page writes.

Pushed to l2-mtd.git.

Brian