提交 7b4b4258 编写于 作者: D David Rientjes 提交者: Linus Torvalds

arch/sh/kernel/dwarf.c: destroy mempools on cleanup

dwarf_reg_pool and dwarf_frame_pool are not properly destroyed when
cleaning up the dwarf unwinder.  Destroy them with mempool_destroy().

Also mark dwarf_unwinder_cleanup() as __init.
Signed-off-by: NDavid Rientjes <rientjes@google.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 5017335d
...@@ -993,7 +993,7 @@ static struct unwinder dwarf_unwinder = { ...@@ -993,7 +993,7 @@ static struct unwinder dwarf_unwinder = {
.rating = 150, .rating = 150,
}; };
static void dwarf_unwinder_cleanup(void) static void __init dwarf_unwinder_cleanup(void)
{ {
struct dwarf_fde *fde, *next_fde; struct dwarf_fde *fde, *next_fde;
struct dwarf_cie *cie, *next_cie; struct dwarf_cie *cie, *next_cie;
...@@ -1009,6 +1009,10 @@ static void dwarf_unwinder_cleanup(void) ...@@ -1009,6 +1009,10 @@ static void dwarf_unwinder_cleanup(void)
rbtree_postorder_for_each_entry_safe(cie, next_cie, &cie_root, node) rbtree_postorder_for_each_entry_safe(cie, next_cie, &cie_root, node)
kfree(cie); kfree(cie);
if (dwarf_reg_pool)
mempool_destroy(dwarf_reg_pool);
if (dwarf_frame_pool)
mempool_destroy(dwarf_frame_pool);
kmem_cache_destroy(dwarf_reg_cachep); kmem_cache_destroy(dwarf_reg_cachep);
kmem_cache_destroy(dwarf_frame_cachep); kmem_cache_destroy(dwarf_frame_cachep);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册