Skip to content

Commit

Permalink
tracing/stat: remember to free root node
Browse files Browse the repository at this point in the history
When closing a trace_stat file, we destroy the rbtree constructed during
file open, but there is memory leak that the root node is not freed.

[ Impact: fix memory leak when closing a trace_stat file ]

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
  • Loading branch information
Li Zefan authored and Frederic Weisbecker committed Jun 1, 2009
1 parent b3dd7ba commit e162280
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/trace/trace_stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ static struct rb_node *release_next(struct rb_node *node)
return node->rb_right;
else {
if (!parent)
return NULL;
if (parent->rb_left == node)
;
else if (parent->rb_left == node)
parent->rb_left = NULL;
else
parent->rb_right = NULL;
Expand Down

0 comments on commit e162280

Please sign in to comment.