diff options
author | David Rientjes <rientjes@google.com> | 2015-04-14 18:42:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-14 19:48:56 -0400 |
commit | 7b4b425897cd582897ccc38b637ce7ab5ffc5593 (patch) | |
tree | 7170fb95137d73487fe8be5f97b40be055c39862 /arch/sh | |
parent | 5017335d6d8c1fc3bbc04f80785440885f305879 (diff) |
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: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/kernel/dwarf.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/sh/kernel/dwarf.c b/arch/sh/kernel/dwarf.c index 67a049e75ec1..60437e9c345e 100644 --- a/arch/sh/kernel/dwarf.c +++ b/arch/sh/kernel/dwarf.c | |||
@@ -993,7 +993,7 @@ static struct unwinder dwarf_unwinder = { | |||
993 | .rating = 150, | 993 | .rating = 150, |
994 | }; | 994 | }; |
995 | 995 | ||
996 | static void dwarf_unwinder_cleanup(void) | 996 | static void __init dwarf_unwinder_cleanup(void) |
997 | { | 997 | { |
998 | struct dwarf_fde *fde, *next_fde; | 998 | struct dwarf_fde *fde, *next_fde; |
999 | struct dwarf_cie *cie, *next_cie; | 999 | struct dwarf_cie *cie, *next_cie; |
@@ -1009,6 +1009,10 @@ static void dwarf_unwinder_cleanup(void) | |||
1009 | rbtree_postorder_for_each_entry_safe(cie, next_cie, &cie_root, node) | 1009 | rbtree_postorder_for_each_entry_safe(cie, next_cie, &cie_root, node) |
1010 | kfree(cie); | 1010 | kfree(cie); |
1011 | 1011 | ||
1012 | if (dwarf_reg_pool) | ||
1013 | mempool_destroy(dwarf_reg_pool); | ||
1014 | if (dwarf_frame_pool) | ||
1015 | mempool_destroy(dwarf_frame_pool); | ||
1012 | kmem_cache_destroy(dwarf_reg_cachep); | 1016 | kmem_cache_destroy(dwarf_reg_cachep); |
1013 | kmem_cache_destroy(dwarf_frame_cachep); | 1017 | kmem_cache_destroy(dwarf_frame_cachep); |
1014 | } | 1018 | } |