mtd: nand: fsl_ifc: Fix eccstat array overflow for IFC ver >= 2.0.0
authorJagdish Gediya <jagdish.gediya@nxp.com>
Wed, 21 Mar 2018 00:21:46 +0000 (05:51 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Mar 2018 16:24:43 +0000 (18:24 +0200)
commit1aa0e4115330282bcb2e7f2a17d7804959d9344d
treeafca16c5eeb39f9820be23b2e5296aa2da2cc567
parent91ff3795b188363ea41950f68cf2c80cca996d25
mtd: nand: fsl_ifc: Fix eccstat array overflow for IFC ver >= 2.0.0

commit 843c3a59997f18060848b8632607dd04781b52d1 upstream.

Number of ECC status registers i.e. (ECCSTATx) has been increased in IFC
version 2.0.0 due to increase in SRAM size. This is causing eccstat
array to over flow.

So, replace eccstat array with u32 variable to make it fail-safe and
independent of number of ECC status registers or SRAM size.

Fixes: bccb06c353af ("mtd: nand: ifc: update bufnum mask for ver >= 2.0.0")
Cc: stable@vger.kernel.org # 3.18+
Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
Signed-off-by: Jagdish Gediya <jagdish.gediya@nxp.com>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mtd/nand/fsl_ifc_nand.c