Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Vasiliy Kulikov and committed by
Greg Kroah-Hartman
340362ab b1f5f54e

+1 -1
+1 -1
drivers/staging/spectra/flash.c
··· 1604 1604 1605 1605 for (n = 0; n < BLK_NUM_FOR_L2_CACHE; n++) { 1606 1606 blk = find_least_worn_blk_for_l2_cache(); 1607 - if (blk > DeviceInfo.wDataBlockNum) { 1607 + if (blk >= DeviceInfo.wDataBlockNum) { 1608 1608 nand_dbg_print(NAND_DBG_WARN, 1609 1609 "find_least_worn_blk_for_l2_cache: " 1610 1610 "No enough free NAND blocks (n: %d) for L2 Cache!\n", n);