Skip to contentSkip to conversation

mtd: rawnand: cortina_nand: missing initialization

PATCH New Heinrich Schuchardt 2 participants 2 messages Feb 20, 2021 – Feb 25, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: rawnand: cortina_nand: missing initialization

ca_do_bch_correction() takes a random value from the stack and starts counting bitflips from this value. Initialize the counter.

This passed unnoticed as the value is finally ignored in the call hierarchy.

Fixes 161df94b3c43 ("mtd: rawnand: cortina_nand: Add Cortina CAxxxx SoC support")
---
 drivers/mtd/nand/raw/cortina_nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/raw/cortina_nand.c +1 -1
index 12bd1ded83..81fa8788a4 100644
@@ -546,7 +546,7 @@ static int ca_do_bch_correction(struct nand_chip *chip,
 	struct nand_drv *info =
 	    (struct nand_drv *)nand_get_controller_data(chip);
 	unsigned int reg_v, err_loc0, err_loc1;
-	int k, max_bitflips;
+	int k, max_bitflips = 0;
 
 	for (k = 0; k < (err_num + 1) / 2; k++) {
 		reg_v = readl(&info->reg->flash_nf_bch_error_loc01 + k);

--
2.30.0

#1 lore raw

PATCH 1/1 mtd: rawnand: cortina_nand: missing initialization

Quoted 8 lines · Heinrich Schuchardt

ca_do_bch_correction() takes a random value from the stack and starts counting bitflips from this value. Initialize the counter.

This passed unnoticed as the value is finally ignored in the call hierarchy.

Fixes 161df94b3c43 ("mtd: rawnand: cortina_nand: Add Cortina CAxxxx SoC support")

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210225/b0384db3/attachment.sig>