Merge tag 'for-linus-20161008' of git://git.infradead.org/linux-mtd
[cascardo/linux.git] / drivers / mtd / nand / mxc_nand.c
index d68314c..d7f724b 100644 (file)
@@ -946,7 +946,7 @@ static int mxc_v2_ooblayout_free(struct mtd_info *mtd, int section,
        struct nand_chip *nand_chip = mtd_to_nand(mtd);
        int stepsize = nand_chip->ecc.bytes == 9 ? 16 : 26;
 
-       if (section > nand_chip->ecc.steps)
+       if (section >= nand_chip->ecc.steps)
                return -ERANGE;
 
        if (!section) {