summaryrefslogtreecommitdiff
path: root/drivers/staging/spectra
diff options
context:
space:
mode:
authorVasiliy Kulikov <segooon@gmail.com>2010-09-19 16:54:40 +0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-09-20 17:03:41 -0700
commit340362abb9544043d41e047c63d86dffe990a48c (patch)
tree2cd8e4fc692cf75af450befb01bb61434c614a53 /drivers/staging/spectra
parentb1f5f54e91e30ecd5ac670edc8bb2c0ee5990d0f (diff)
staging: spectra: off by one
g_pBlockTable has only DeviceInfo.wDataBlockNum elements. Signed-off-by: Vasiliy Kulikov <segooon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/spectra')
-rw-r--r--drivers/staging/spectra/flash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/spectra/flash.c b/drivers/staging/spectra/flash.c
index 9b5218b6ada..4e6e451cd5c 100644
--- a/drivers/staging/spectra/flash.c
+++ b/drivers/staging/spectra/flash.c
@@ -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);