Commit bc10e875 authored by Marek Skuczynski's avatar Marek Skuczynski Committed by Paul Mundt

sh: Fix access to released memory in clk_debugfs_register_one()

Signed-off-by: default avatarMarek Skuczynski <mareksk7@gmail.com>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 00b3e0a2
...@@ -598,7 +598,7 @@ static struct dentry *clk_debugfs_root; ...@@ -598,7 +598,7 @@ static struct dentry *clk_debugfs_root;
static int clk_debugfs_register_one(struct clk *c) static int clk_debugfs_register_one(struct clk *c)
{ {
int err; int err;
struct dentry *d, *child; struct dentry *d, *child, *child_tmp;
struct clk *pa = c->parent; struct clk *pa = c->parent;
char s[255]; char s[255];
char *p = s; char *p = s;
...@@ -630,7 +630,7 @@ static int clk_debugfs_register_one(struct clk *c) ...@@ -630,7 +630,7 @@ static int clk_debugfs_register_one(struct clk *c)
err_out: err_out:
d = c->dentry; 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(child);
debugfs_remove(c->dentry); debugfs_remove(c->dentry);
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment