]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mtd: spinand: Add missing check
authorMiquel Raynal <miquel.raynal@bootlin.com>
Fri, 9 Jan 2026 17:18:03 +0000 (18:18 +0100)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Thu, 29 Jan 2026 19:21:40 +0000 (20:21 +0100)
The update cache variant is mandatory, both read and write versions are
being checked, but not this one. All chip drivers seem to implement this
variant, so there should be no breakage.

Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/spi/core.c

index 0346916b032bda60e1177c19dba473cbe1c814dc..19100ea77e3335f427ff94fcd46426b01db93c30 100644 (file)
@@ -1430,6 +1430,9 @@ int spinand_match_and_init(struct spinand_device *spinand,
 
                op = spinand_select_op_variant(spinand,
                                               info->op_variants.update_cache);
+               if (!op)
+                       return -ENOTSUPP;
+
                spinand->op_templates.update_cache = op;
 
                return 0;