Skip to content

Commit bc10e87

Browse files
marekskpmundt
authored andcommitted
sh: Fix access to released memory in clk_debugfs_register_one()
Signed-off-by: Marek Skuczynski <mareksk7@gmail.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
1 parent 00b3e0a commit bc10e87

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎arch/sh/kernel/cpu/clock.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ static struct dentry *clk_debugfs_root;
598598
static int clk_debugfs_register_one(struct clk *c)
599599
{
600600
int err;
601-
struct dentry *d, *child;
601+
struct dentry *d, *child, *child_tmp;
602602
struct clk *pa = c->parent;
603603
char s[255];
604604
char *p = s;
@@ -630,7 +630,7 @@ static int clk_debugfs_register_one(struct clk *c)
630630

631631
err_out:
632632
d = c->dentry;
633-
list_for_each_entry(child, &d->d_subdirs, d_u.d_child)
633+
list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child)
634634
debugfs_remove(child);
635635
debugfs_remove(c->dentry);
636636
return err;

0 commit comments

Comments
 (0)