Skip to content

Commit

Permalink
sh: Fix access to released memory in dwarf_unwinder_cleanup()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Marek Skuczynski authored and Paul Mundt committed Feb 2, 2010
1 parent e5ff15b commit 00b3e0a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions arch/sh/kernel/dwarf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 00b3e0a

Please sign in to comment.