提交 69648bed 编写于 作者: V Vasiliy Kulikov 提交者: Greg Kroah-Hartman

staging: zcache: fix memory leak

obj is not freed if __get_free_page() failed.
Signed-off-by: NVasiliy Kulikov <segoon@openwall.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 7a9f437a
......@@ -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();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册