
From: Anton Blanchard <anton@samba.org>

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: Anton Blanchard <anton@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/drivers/oprofile/cpu_buffer.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff -puN drivers/oprofile/cpu_buffer.c~fix-oprofile-vfree-warning-on-error drivers/oprofile/cpu_buffer.c
--- 25/drivers/oprofile/cpu_buffer.c~fix-oprofile-vfree-warning-on-error	2004-09-05 14:45:01.464715632 -0700
+++ 25-akpm/drivers/oprofile/cpu_buffer.c	2004-09-05 14:45:01.468715024 -0700
@@ -36,8 +36,10 @@ static void __free_cpu_buffers(int num)
 {
 	int i;
  
-	for_each_online_cpu(i)
-		vfree(cpu_buffer[i].buffer);
+	for_each_online_cpu(i) {
+		if (cpu_buffer[i].buffer)
+			vfree(cpu_buffer[i].buffer);
+	}
 }
  
  
_
