lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1284900881-24243-1-git-send-email-segooon@gmail.com>
Date:	Sun, 19 Sep 2010 16:54:40 +0400
From:	Vasiliy Kulikov <segooon@...il.com>
To:	kernel-janitors@...r.kernel.org
Cc:	Greg Kroah-Hartman <gregkh@...e.de>,
	Javier Martinez Canillas <martinez.javier@...il.com>,
	David Woodhouse <David.Woodhouse@...el.com>,
	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: [PATCH] staging: spectra: off by one

g_pBlockTable has only DeviceInfo.wDataBlockNum elements.

Signed-off-by: Vasiliy Kulikov <segooon@...il.com>
---
 compile tested.

 drivers/staging/spectra/flash.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/spectra/flash.c b/drivers/staging/spectra/flash.c
index 9b5218b..4e6e451 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);
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ