All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Levon <levon@movementarian.org>
To: Anton Blanchard <anton@samba.org>
Cc: akpm@osdl.org, phil.el@wanadoo.fr, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fix oprofile vfree warning on error
Date: Sun, 5 Sep 2004 15:32:01 +0100	[thread overview]
Message-ID: <20040905143201.GB79932@compsoc.man.ac.uk> (raw)
In-Reply-To: <20040904174642.GD7716@krispykreme>

On Sun, Sep 05, 2004 at 03:46:42AM +1000, Anton Blanchard wrote:

> 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.

Why does vfree() differ from free() / kfree() in not accepting NULL ?
This seems like an interface wart.

cheers
john

> -	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);
> +	}

  parent reply	other threads:[~2004-09-05 14:32 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 ` [PATCH] fix oprofile vfree warning on error Anton Blanchard
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   ` John Levon [this message]
2004-09-06  8:51     ` [PATCH] fix oprofile vfree warning on error 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=20040905143201.GB79932@compsoc.man.ac.uk \
    --to=levon@movementarian.org \
    --cc=akpm@osdl.org \
    --cc=anton@samba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.