tracing/stat: remember to free root node
authorLi Zefan <lizf@cn.fujitsu.com>
Wed, 27 May 2009 03:04:48 +0000 (11:04 +0800)
committerFrederic Weisbecker <fweisbec@gmail.com>
Mon, 1 Jun 2009 23:18:03 +0000 (01:18 +0200)
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>
kernel/trace/trace_stat.c

index 5816d1aebcc9f71a8c78813060759c7da44081cc..8030ec98dbad0c6b5d8bd8e5f57f3d2353fcf8d1 100644 (file)
@@ -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;