diff options
author | Marek Skuczynski <mareksk7@gmail.com> | 2010-01-30 16:27:41 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-02-01 21:32:22 -0500 |
commit | 00b3e0a2e059f0601feb537b995b0b4de531b543 (patch) | |
tree | 47716a8c9f0866dae2080ddfac1e787d211adc32 /arch | |
parent | e5ff15bec96ba18698dae5de0bbf7e6a0653ca65 (diff) |
sh: Fix access to released memory in dwarf_unwinder_cleanup()
Signed-off-by: Marek Skuczynski <mareksk7@gmail.com>
Acked-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sh/kernel/dwarf.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/sh/kernel/dwarf.c b/arch/sh/kernel/dwarf.c index 3576b709f052..88d28ec3780a 100644 --- a/arch/sh/kernel/dwarf.c +++ b/arch/sh/kernel/dwarf.c | |||
@@ -892,18 +892,18 @@ static struct unwinder dwarf_unwinder = { | |||
892 | 892 | ||
893 | static void dwarf_unwinder_cleanup(void) | 893 | static void dwarf_unwinder_cleanup(void) |
894 | { | 894 | { |
895 | struct dwarf_cie *cie; | 895 | struct dwarf_cie *cie, *cie_tmp; |
896 | struct dwarf_fde *fde; | 896 | struct dwarf_fde *fde, *fde_tmp; |
897 | 897 | ||
898 | /* | 898 | /* |
899 | * Deallocate all the memory allocated for the DWARF unwinder. | 899 | * Deallocate all the memory allocated for the DWARF unwinder. |
900 | * Traverse all the FDE/CIE lists and remove and free all the | 900 | * Traverse all the FDE/CIE lists and remove and free all the |
901 | * memory associated with those data structures. | 901 | * memory associated with those data structures. |
902 | */ | 902 | */ |
903 | list_for_each_entry(cie, &dwarf_cie_list, link) | 903 | list_for_each_entry_safe(cie, cie_tmp, &dwarf_cie_list, link) |
904 | kfree(cie); | 904 | kfree(cie); |
905 | 905 | ||
906 | list_for_each_entry(fde, &dwarf_fde_list, link) | 906 | list_for_each_entry_safe(fde, fde_tmp, &dwarf_fde_list, link) |
907 | kfree(fde); | 907 | kfree(fde); |
908 | 908 | ||
909 | kmem_cache_destroy(dwarf_reg_cachep); | 909 | kmem_cache_destroy(dwarf_reg_cachep); |