summaryrefslogtreecommitdiff
path: root/drivers/staging/spectra
diff options
context:
space:
mode:
authorroel kluin <roel.kluin@gmail.com>2011-01-03 19:59:14 (GMT)
committerGreg Kroah-Hartman <gregkh@suse.de>2011-01-21 20:13:07 (GMT)
commitaa96646daa15d6ac05addc7db7272dd5787c6953 (patch)
tree7f79b9dabbdc90b086d705c11aced740af7d835c /drivers/staging/spectra
parente508edb203352e044dac359fb98579508bf7376c (diff)
downloadlinux-fsl-qoriq-aa96646daa15d6ac05addc7db7272dd5787c6953.tar.xz
staging: spectra: don't read past array in Conv_Spare_Data_Log2Phy_Format()
It should decrement or we read past the array Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/spectra')
-rw-r--r--drivers/staging/spectra/lld_nand.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/spectra/lld_nand.c b/drivers/staging/spectra/lld_nand.c
index 2263d3e..0be7adc 100644
--- a/drivers/staging/spectra/lld_nand.c
+++ b/drivers/staging/spectra/lld_nand.c
@@ -1400,7 +1400,7 @@ void Conv_Spare_Data_Log2Phy_Format(u8 *data)
const u32 PageSpareSize = DeviceInfo.wPageSpareSize;
if (enable_ecc) {
- for (i = spareFlagBytes - 1; i >= 0; i++)
+ for (i = spareFlagBytes - 1; i >= 0; i--)
data[PageSpareSize - spareFlagBytes + i] = data[i];
}
}