Commit 24668b77 authored by Anton Blanchard's avatar Anton Blanchard Committed by Linus Torvalds

[PATCH] fix oprofile vfree warning on error

On error we can call __free_cpu_buffers with only some buffers allocated.
I was getting a bunch of vfree warnings when I hit it, we should check
before calling vfree.
Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 319cb26c
...@@ -36,8 +36,10 @@ static void __free_cpu_buffers(int num) ...@@ -36,8 +36,10 @@ static void __free_cpu_buffers(int num)
{ {
int i; int i;
for_each_online_cpu(i) for_each_online_cpu(i) {
if (cpu_buffer[i].buffer)
vfree(cpu_buffer[i].buffer); vfree(cpu_buffer[i].buffer);
}
} }
......
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