Skip to content

Commit

Permalink
arch/sh/kernel/dwarf.c: destroy mempools on cleanup
Browse files Browse the repository at this point in the history
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: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
rientjes authored and torvalds committed Apr 14, 2015
1 parent 5017335 commit 7b4b425
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion arch/sh/kernel/dwarf.c
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ static struct unwinder dwarf_unwinder = {
.rating = 150,
};

static void dwarf_unwinder_cleanup(void)
static void __init dwarf_unwinder_cleanup(void)
{
struct dwarf_fde *fde, *next_fde;
struct dwarf_cie *cie, *next_cie;
Expand All @@ -1009,6 +1009,10 @@ static void dwarf_unwinder_cleanup(void)
rbtree_postorder_for_each_entry_safe(cie, next_cie, &cie_root, node)
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_frame_cachep);
}
Expand Down

0 comments on commit 7b4b425

Please sign in to comment.