Commit 69648bed authored by Vasiliy Kulikov's avatar Vasiliy Kulikov Committed by Greg Kroah-Hartman

staging: zcache: fix memory leak

obj is not freed if __get_free_page() failed.
Signed-off-by: default avatarVasiliy Kulikov <segoon@openwall.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7a9f437a
...@@ -790,6 +790,7 @@ static int zcache_do_preload(struct tmem_pool *pool) ...@@ -790,6 +790,7 @@ static int zcache_do_preload(struct tmem_pool *pool)
page = (void *)__get_free_page(ZCACHE_GFP_MASK); page = (void *)__get_free_page(ZCACHE_GFP_MASK);
if (unlikely(page == NULL)) { if (unlikely(page == NULL)) {
zcache_failed_get_free_pages++; zcache_failed_get_free_pages++;
kmem_cache_free(zcache_obj_cache, obj);
goto unlock_out; goto unlock_out;
} }
preempt_disable(); preempt_disable();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment