public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Anton Blanchard <anton@samba.org>
To: akpm@osdl.org
Cc: levon@movementarian.org, phil.el@wanadoo.fr,
	linux-kernel@vger.kernel.org
Subject: [PATCH] fix oprofile vfree warning on error
Date: Sun, 5 Sep 2004 03:46:42 +1000	[thread overview]
Message-ID: <20040904174642.GD7716@krispykreme> (raw)
In-Reply-To: <20040904174403.GC7716@krispykreme>


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>

diff -puN drivers/oprofile/cpu_buffer.c~oprofile_vfree_fix drivers/oprofile/cpu_buffer.c
--- linux-2.5/drivers/oprofile/cpu_buffer.c~oprofile_vfree_fix	2004-09-05 02:37:38.223212931 +1000
+++ linux-2.5-anton/drivers/oprofile/cpu_buffer.c	2004-09-05 02:37:43.608142109 +1000
@@ -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);
+	}
 }
  
  

_

  reply	other threads:[~2004-09-04 17:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-04 17:44 [PATCH] use for_each_cpu in oprofile code Anton Blanchard
2004-09-04 17:46 ` Anton Blanchard [this message]
2004-09-04 17:57   ` [PATCH] Speed up oprofile buffer drain code Anton Blanchard
2004-09-05 18:26     ` John Levon
2004-09-05 14:32   ` [PATCH] fix oprofile vfree warning on error John Levon
2004-09-06  8:51     ` Anton Blanchard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040904174642.GD7716@krispykreme \
    --to=anton@samba.org \
    --cc=akpm@osdl.org \
    --cc=levon@movementarian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=phil.el@wanadoo.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox