Skip to contentSkip to conversation

mtd: nand: fix return value in nand_erase_nand()

PATCH In review Dan Carpenter 2 participants 2 messages Mar 21, 2018

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

PATCH 1/1 mtd: nand: fix return value in nand_erase_nand()

The problem is that "ret" isn't initialized on the success path.

Fixes cc4ac09da649 ("mtd: Stop updating erase_info->state and calling mtd_erase_callback()")
drivers/mtd/nand/raw/nand_base.c +1 -0
index 13dd67106859..87b72bf626ae 100644
@@ -4653,6 +4653,7 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
 		}
 	}
 
+	ret = 0;
 erase_exit:
 
 	/* Deselect and wake up anyone waiting on the device */
#1 lore raw

Hi Dan,

Quoted 4 lines · On Wed, 21 Mar 2018 11:10:14 +0300 Dan Carpenter <[email protected]>…

The problem is that "ret" isn't initialized on the success path.

Fixes cc4ac09da649 ("mtd: Stop updating erase_info->state and calling mtd_erase_callback()")

I squashed those changes into the offending commit.

As usual, thanks for this report (and fix).

Boris

Quoted 13 lines
drivers/mtd/nand/raw/nand_base.c +1 -0
index 13dd67106859..87b72bf626ae 100644
@@ -4653,6 +4653,7 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
 		}
 	}
 
+	ret = 0;
 erase_exit:
 
 	/* Deselect and wake up anyone waiting on the device */
Signature · 3 lines
Boris Brezillon, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com