]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mtd: rawnand: stm32_fmc2: fix ECC overwrite
authorChristophe Kerello <christophe.kerello@foss.st.com>
Tue, 12 Aug 2025 07:30:08 +0000 (09:30 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Sep 2025 14:35:46 +0000 (16:35 +0200)
commitb6f8cd737b70ff414bd6b710d7b0408f91e00b36
tree4f9116cdea5ce9b5a2ac1e5bef60cb6602d3b291
parent26adba1e7d7924174e15a3ba4b1132990786300b
mtd: rawnand: stm32_fmc2: fix ECC overwrite

commit 811c0da4542df3c065f6cb843ced68780e27bb44 upstream.

In case OOB write is requested during a data write, ECC is currently
lost. Avoid this issue by only writing in the free spare area.
This issue has been seen with a YAFFS2 file system.

Signed-off-by: Christophe Kerello <christophe.kerello@foss.st.com>
Cc: stable@vger.kernel.org
Fixes: 2cd457f328c1 ("mtd: rawnand: stm32_fmc2: add STM32 FMC2 NAND flash controller driver")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mtd/nand/raw/stm32_fmc2_nand.c