aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Skuczynski <mareksk7@gmail.com>2010-01-30 22:27:41 +0100
committerPaul Mundt <lethal@linux-sh.org>2010-02-02 11:32:22 +0900
commit00b3e0a2e059f0601feb537b995b0b4de531b543 (patch)
tree47716a8c9f0866dae2080ddfac1e787d211adc32
parente5ff15bec96ba18698dae5de0bbf7e6a0653ca65 (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>
-rw-r--r--arch/sh/kernel/dwarf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/sh/kernel/dwarf.c b/arch/sh/kernel/dwarf.c
index 3576b709f05..88d28ec3780 100644
--- a/arch/sh/kernel/dwarf.c
+++ b/arch/sh/kernel/dwarf.c
@@ -892,18 +892,18 @@ static struct unwinder dwarf_unwinder = {
static void dwarf_unwinder_cleanup(void)
{
- struct dwarf_cie *cie;
- struct dwarf_fde *fde;
+ struct dwarf_cie *cie, *cie_tmp;
+ struct dwarf_fde *fde, *fde_tmp;
/*
* Deallocate all the memory allocated for the DWARF unwinder.
* Traverse all the FDE/CIE lists and remove and free all the
* memory associated with those data structures.
*/
- list_for_each_entry(cie, &dwarf_cie_list, link)
+ list_for_each_entry_safe(cie, cie_tmp, &dwarf_cie_list, link)
kfree(cie);
- list_for_each_entry(fde, &dwarf_fde_list, link)
+ list_for_each_entry_safe(fde, fde_tmp, &dwarf_fde_list, link)
kfree(fde);
kmem_cache_destroy(dwarf_reg_cachep);