From: Brian Norris Date: Tue, 2 May 2017 00:04:55 +0000 (-0700) Subject: mtd: nand: samsung: warn about un-parseable ECC info X-Git-Tag: v4.14-rc1~800^2^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d24197907454b902908e025bce4b8bc677d3ba6b;p=platform%2Fkernel%2Flinux-rpi.git mtd: nand: samsung: warn about un-parseable ECC info We don't handle cases larger than 7. We probably shouldn't pretend we know the ECC step size in this case, and it's probably also good to WARN() like we do in many other similar cases. Fixes: 8fc82d456e40 ("mtd: nand: samsung: Retrieve ECC requirements from extended ID") Signed-off-by: Brian Norris Signed-off-by: Boris Brezillon --- diff --git a/drivers/mtd/nand/nand_samsung.c b/drivers/mtd/nand/nand_samsung.c index 9cfc403..1e07559 100644 --- a/drivers/mtd/nand/nand_samsung.c +++ b/drivers/mtd/nand/nand_samsung.c @@ -84,6 +84,9 @@ static void samsung_nand_decode_id(struct nand_chip *chip) case 7: chip->ecc_strength_ds = 60; break; + default: + WARN(1, "Could not decode ECC info"); + chip->ecc_step_ds = 0; } } } else {