mtd: rawnand: brcmnand: fix status read of brcmnand_waitfunc
PATCH 1/1 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 f504551b7f15 ("mtd: rawnand: Propagate error and simplify ternary operators for brcmstb_nand_wait_for_completion()")
Signed-off-by david regan <[email protected]>
Reviewed-by William Zhang <[email protected]>
--- drivers/mtd/nand/raw/brcmnand/brcmnand.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/mtd/nand/raw/brcmnand/brcmnand.c +5 -0
@@ -1893,6 +1893,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);
Signature · 1 line
2.37.3
Quoted 4 lines · david regan
This change fixes an issue where an error return value may be mistakenly used as NAND status.
Applied to nand/next, thanks!
[1/1] mtd: rawnand: brcmnand: fix status read of brcmnand_waitfunc
commit: 03271ea36ea7a58d30a4bde182eb2a0d46220467
Patche(s) will be available within hours on:
mtd/linux.git
Kind regards,
Miquèl