From 69648bed5383d5e9454aa9dc922dee4db2eef794 Mon Sep 17 00:00:00 2001 From: Vasiliy Kulikov Date: Thu, 10 Feb 2011 21:00:39 +0300 Subject: [PATCH] staging: zcache: fix memory leak obj is not freed if __get_free_page() failed. Signed-off-by: Vasiliy Kulikov Signed-off-by: Greg Kroah-Hartman --- drivers/staging/zcache/zcache.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/zcache/zcache.c b/drivers/staging/zcache/zcache.c index 61be8498fb0..b8a2b30a157 100644 --- a/drivers/staging/zcache/zcache.c +++ b/drivers/staging/zcache/zcache.c @@ -790,6 +790,7 @@ static int zcache_do_preload(struct tmem_pool *pool) page = (void *)__get_free_page(ZCACHE_GFP_MASK); if (unlikely(page == NULL)) { zcache_failed_get_free_pages++; + kmem_cache_free(zcache_obj_cache, obj); goto unlock_out; } preempt_disable(); -- 2.11.4.GIT