]> 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:29:57 +0000 (16:29 +0200)
commite9874dc405ebfb4c656a8415ca152409552da53d
tree572afcc7a56122ec96fe0e7902149f38a985b68f
parent75686c49574dd5f171ca682c18717787f1d8d55e
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