Skip to content

Commit

Permalink
staging: spectra: don't read past array in Conv_Spare_Data_Log2Phy_Fo…
Browse files Browse the repository at this point in the history
…rmat()

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>
  • Loading branch information
roel kluin authored and Greg Kroah-Hartman committed Jan 21, 2011
1 parent e508edb commit aa96646
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/spectra/lld_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
}
Expand Down

0 comments on commit aa96646

Please sign in to comment.