Re: [RFC][PATCH 0/5] do not dereference NULL pools in pools' destroy() functions

From: Andrew Morton
Date: Thu Jun 11 2015 - 13:38:22 EST


On Thu, 11 Jun 2015 12:26:11 -0500 (CDT) Christoph Lameter <cl@xxxxxxxxx> wrote:

> On Tue, 9 Jun 2015, Andrew Morton wrote:
>
> > > > More than half of the kmem_cache_destroy() callsites are declining that
> > > > value by open-coding the NULL test. That's reality and we should recognize
> > > > it.
> > >
> > > Well that may just indicate that we need to have a look at those
> > > callsites and the reason there to use a special cache at all.
> >
> > This makes no sense. Go look at the code.
> > drivers/staging/lustre/lustre/llite/super25.c, for example. It's all
> > in the basic unwind/recover/exit code.
>
> That is screwed up code. I'd do that without the checks simply with a
> series of kmem_cache_destroys().

So go and review some of the many other callers which do this.


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