Re: [PATCH] hw breakpoint: Fix possible memory leak

From: Ingo Molnar
Date: Mon Feb 27 2012 - 05:45:15 EST



* Peter Zijlstra <a.p.zijlstra@xxxxxxxxx> wrote:

> On Mon, 2012-02-27 at 12:02 +0900, Namhyung Kim wrote:
> > If kzalloc() for TYPE_DATA failed on a given cpu, previous chunk
> > will be leaked. Fix it.
>
> so why not fix the error loop? wouldn't putting that err_cpu == cpu
> break after the kfree sort it?

I edited that code earlier today - is the form below OK, or can
you see a simpler method? It's not yet pushed out so can still
edit it.

Thanks,

Ingo