提交 4bcf349a 编写于 作者: P Paul Mackerras 提交者: Ingo Molnar

perfcounters: fix refcounting bug, take 2

Only free child_counter if it has a parent; if it doesn't, then it
has a file pointing to it and we'll free it in perf_release.
Signed-off-by: NMike Galbraith <efault@gmx.de>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 5af75917
......@@ -1958,14 +1958,13 @@ __perf_counter_exit_task(struct task_struct *child,
sync_child_counter(child_counter, parent_counter);
list_for_each_entry_safe(sub, tmp, &child_counter->sibling_list,
list_entry) {
if (sub->parent)
if (sub->parent) {
sync_child_counter(sub, sub->parent);
kfree(sub);
}
}
if (!child_counter->filp || !atomic_long_read(&child_counter->filp->f_count))
kfree(child_counter);
}
}
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册