Re: [PATCH] fix oprofile vfree warning on error

From: John Levon
Date: Sun Sep 05 2004 - 09:33:38 EST


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);
> + }
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/