From: Vasiliy Kulikov Date: Thu, 10 Feb 2011 18:00:39 +0000 (+0300) Subject: staging: zcache: fix memory leak X-Git-Tag: MMI-PSA29.97-13-9~20521^2~496 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=69648bed5383d5e9454aa9dc922dee4db2eef794;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 --- diff --git a/drivers/staging/zcache/zcache.c b/drivers/staging/zcache/zcache.c index 61be8498fb06..b8a2b30a1572 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();