mirror of
https://github.com/torvalds/linux.git
synced 2026-01-25 15:03:52 +08:00
mtd: rawnand: brcmnand: fix status read of brcmnand_waitfunc
This change fixes an issue where an error return value may be mistakenly
used as NAND status.
Fixes: f504551b7f ("mtd: rawnand: Propagate error and simplify ternary operators for brcmstb_nand_wait_for_completion()")
Signed-off-by: david regan <dregan@broadcom.com>
Reviewed-by: William Zhang <william.zhang@broadcom.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
This commit is contained in:
committed by
Miquel Raynal
parent
1a50e3612d
commit
03271ea36e
@@ -2342,6 +2342,11 @@ static int brcmnand_write(struct mtd_info *mtd, struct nand_chip *chip,
|
||||
brcmnand_send_cmd(host, CMD_PROGRAM_PAGE);
|
||||
status = brcmnand_waitfunc(chip);
|
||||
|
||||
if (status < 0) {
|
||||
ret = status;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (status & NAND_STATUS_FAIL) {
|
||||
dev_info(ctrl->dev, "program failed at %llx\n",
|
||||
(unsigned long long)addr);
|
||||
|
||||
Reference in New Issue
Block a user