mtd: rawnand: atmel: Check return values for nand_read_data_op

In atmel_nand_pmecc_read_pg(), nand_read_data_op() is called twice
without the return values being checked for errors. Add these checks.

Signed-off-by: Alex Dewar <alex.dewar90@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200914214245.14626-1-alex.dewar90@gmail.com
This commit is contained in:
Alex Dewar 2020-09-14 22:42:44 +01:00 committed by Miquel Raynal
parent f7721e4bfe
commit d27c9859a0
1 changed files with 8 additions and 2 deletions

View File

@ -948,11 +948,17 @@ static int atmel_nand_pmecc_read_pg(struct nand_chip *chip, u8 *buf,
if (ret) if (ret)
return ret; return ret;
nand_read_data_op(chip, buf, mtd->writesize, false, false); ret = nand_read_data_op(chip, buf, mtd->writesize, false, false);
nand_read_data_op(chip, chip->oob_poi, mtd->oobsize, false, false); if (ret)
goto out_disable;
ret = nand_read_data_op(chip, chip->oob_poi, mtd->oobsize, false, false);
if (ret)
goto out_disable;
ret = atmel_nand_pmecc_correct_data(chip, buf, raw); ret = atmel_nand_pmecc_correct_data(chip, buf, raw);
out_disable:
atmel_nand_pmecc_disable(chip, raw); atmel_nand_pmecc_disable(chip, raw);
return ret; return ret;