From 00b3e0a2e059f0601feb537b995b0b4de531b543 Mon Sep 17 00:00:00 2001 From: Marek Skuczynski Date: Sat, 30 Jan 2010 22:27:41 +0100 Subject: sh: Fix access to released memory in dwarf_unwinder_cleanup() Signed-off-by: Marek Skuczynski Acked-by: Matt Fleming Signed-off-by: Paul Mundt --- arch/sh/kernel/dwarf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'arch') 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 = { 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); -- cgit v1.2.3-59-g8ed1b From bc10e875d4aeaa93a0d418d8b4346b72f5067ea0 Mon Sep 17 00:00:00 2001 From: Marek Skuczynski Date: Sat, 30 Jan 2010 22:29:32 +0100 Subject: sh: Fix access to released memory in clk_debugfs_register_one() Signed-off-by: Marek Skuczynski Signed-off-by: Paul Mundt --- arch/sh/kernel/cpu/clock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch') diff --git a/arch/sh/kernel/cpu/clock.c b/arch/sh/kernel/cpu/clock.c index f3a46be2ae81..83da5debeedf 100644 --- a/arch/sh/kernel/cpu/clock.c +++ b/arch/sh/kernel/cpu/clock.c @@ -598,7 +598,7 @@ static struct dentry *clk_debugfs_root; static int clk_debugfs_register_one(struct clk *c) { int err; - struct dentry *d, *child; + struct dentry *d, *child, *child_tmp; struct clk *pa = c->parent; char s[255]; char *p = s; @@ -630,7 +630,7 @@ static int clk_debugfs_register_one(struct clk *c) err_out: d = c->dentry; - list_for_each_entry(child, &d->d_subdirs, d_u.d_child) + list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child) debugfs_remove(child); debugfs_remove(c->dentry); return err; -- cgit v1.2.3-59-g8ed1b