提交 f4156d1c 编写于 作者: C Carl Love 提交者: Paul Mackerras

powerpc/cell/oprofile: Avoid double vfree of profile buffer

If an error occurs on opcontrol start, the event and per cpu buffers
are released.  If later opcontrol shutdown is called then the free
function will be called again to free buffers that no longer
exist.  This results in a kernel oops.  The following changes
prevent the call to delete buffers that don't exist.
Signed-off-by: NCarl Love <carll@us.ibm.com>
Signed-off-by: NArnd Bergmann <arnd@arndb.de>
Acked-by: NRobert Richter <robert.richter@amd.com>
Signed-off-by: NPaul Mackerras <paulus@samba.org>
上级 2bb2e1db
......@@ -38,8 +38,10 @@ void free_cpu_buffers(void)
{
int i;
for_each_online_cpu(i)
for_each_online_cpu(i) {
vfree(per_cpu(cpu_buffer, i).buffer);
per_cpu(cpu_buffer, i).buffer = NULL;
}
}
int alloc_cpu_buffers(void)
......
......@@ -93,6 +93,8 @@ int alloc_event_buffer(void)
void free_event_buffer(void)
{
vfree(event_buffer);
event_buffer = NULL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册