* [PATCH] staging: spectra: don't read past array in Conv_Spare_Data_Log2Phy_Format()
@ 2011-01-01 16:24 roel kluin
0 siblings, 0 replies; only message in thread
From: roel kluin @ 2011-01-01 16:24 UTC (permalink / raw)
To: Andrew Morton, LKML, segooon
It should decrement or we read past the array
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
drivers/staging/spectra/lld_nand.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/spectra/lld_nand.c b/drivers/staging/spectra/lld_nand.c
index 0d647a8..79d00e8 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];
}
}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-01-01 16:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-01 16:24 [PATCH] staging: spectra: don't read past array in Conv_Spare_Data_Log2Phy_Format() roel kluin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox