Re: [PATCH] fix oprofile vfree warning on error

John Levon
2004-09-05T14:32:08Z

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