Skip to content

Commit

Permalink
staging: spectra: off by one
Browse files Browse the repository at this point in the history
g_pBlockTable has only DeviceInfo.wDataBlockNum elements.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Vasiliy Kulikov authored and Greg Kroah-Hartman committed Sep 21, 2010
1 parent b1f5f54 commit 340362a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/spectra/flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -1604,7 +1604,7 @@ static int get_l2_cache_blks(void)

for (n = 0; n < BLK_NUM_FOR_L2_CACHE; n++) {
blk = find_least_worn_blk_for_l2_cache();
if (blk > DeviceInfo.wDataBlockNum) {
if (blk >= DeviceInfo.wDataBlockNum) {
nand_dbg_print(NAND_DBG_WARN,
"find_least_worn_blk_for_l2_cache: "
"No enough free NAND blocks (n: %d) for L2 Cache!\n", n);
Expand Down

0 comments on commit 340362a

Please sign in to comment.