From 6463e79a7c29280b25c6e875b66c4ec1ae88cb89 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Mon, 1 Mar 2010 19:41:14 +0000 Subject: [PATCH] Fixes crash on very big buffers allocations reported by Matteo Tescione and others git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1527 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scst/src/scst_mem.c b/scst/src/scst_mem.c index 8cd706737..52250c79c 100644 --- a/scst/src/scst_mem.c +++ b/scst/src/scst_mem.c @@ -1329,7 +1329,7 @@ static int sgv_pool_init(struct sgv_pool *pool, const char *name, pool->purge_interval = SGV_DEFAULT_PURGE_INTERVAL; if (single_alloc_pages == 0) { pool->max_caches = SGV_POOL_ELEMENTS; - pool->max_cached_pages = 1 << SGV_POOL_ELEMENTS; + pool->max_cached_pages = 1 << (SGV_POOL_ELEMENTS - 1); } else { pool->max_caches = 1; pool->max_cached_pages = single_alloc_pages;