linux/include/linux/mtd
Nuno Sá b890e61637 mtd: spinand: fix NULL pointer dereference with no ECC engine
When "nand-no-ecc-engine" is set in DT, nanddev_get_ecc_engine() takes
the NAND_ECC_ENGINE_TYPE_NONE path and returns success while leaving
nand->ecc.engine NULL. The SPI-NAND code nevertheless dereferences it
unconditionally to test for a pipelined engine, so probing such a
device oopses immediately.

Rather than open-coding the test three times, add a
nand_ecc_is_pipelined() helper to the NAND core that folds the NULL
check into the integration comparison, and use it everywhere. Future
callers then cannot reintroduce the problem.

Fixes: f9d7c7265b ("mtd: spinand: Create direct mapping descriptors for ECC operations")
Cc: stable@vger.kernel.org
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
2026-09-04 20:32:21 +02:00
..
bbm.h
blktrans.h
cfi_endian.h
cfi.h
concat.h mtd: concat: replace alloc + calloc with 1 alloc 2026-03-11 16:23:57 +01:00
doc2000.h
flashchip.h
ftl.h
gen_probe.h
hyperbus.h
inftl.h
jedec.h treewide: Update email address 2026-01-11 06:09:11 -10:00
lpc32xx_mlc.h
lpc32xx_slc.h
map.h
mtd.h
mtdram.h
nand-ecc-mtk.h
nand-ecc-mxic.h
nand-ecc-sw-bch.h
nand-ecc-sw-hamming.h treewide: Update email address 2026-01-11 06:09:11 -10:00
nand-gpio.h
nand-qpic-common.h mtd: rawnand: qcom: Make has_onfi_read_op separate from qpic_version2 2026-07-17 17:47:41 +02:00
nand.h mtd: spinand: fix NULL pointer dereference with no ECC engine 2026-09-04 20:32:21 +02:00
ndfc.h treewide: Update email address 2026-01-11 06:09:11 -10:00
nftl.h
onenand_regs.h
onenand.h
onfi.h treewide: Update email address 2026-01-11 06:09:11 -10:00
partitions.h
pfow.h
physmap.h
pismo.h
plat-ram.h
platnand.h treewide: Update email address 2026-01-11 06:09:11 -10:00
qinfo.h
rawnand.h treewide: Update email address 2026-01-11 06:09:11 -10:00
sh_flctl.h
sharpsl.h
spear_smi.h
spi-nor.h mtd: spi-nor: swp: Add support for the complement feature 2026-05-27 14:36:02 +02:00
spinand.h mtd: spinand: add support for HeYangTek HYF1GQ4UDACAE 2026-06-29 16:46:32 +02:00
super.h
ubi.h
xip.h