lkml.org 
[lkml]   [2014]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm/sl[aou]b: make kfree() aware of error pointers
On Wed, 10 Sep 2014, Dan Carpenter wrote:

> > BTW if we stretch this argument a little bit more, we should also kill the
> > ZERO_OR_NULL_PTR() check from kfree() and make it callers responsibility
> > to perform the checking only if applicable ... we are currently doing a
> > lot of pointless checking in cases where caller would be able to guarantee
> > that the pointer is going to be non-NULL.
>
> What you're saying is that we should remove the ZERO_SIZE_PTR
> completely. ZERO_SIZE_PTR is a very useful idiom and also it's too late
> to remove it because everything depends on it.

I was just argumenting that if we care about single additional test in
this path, the ZERO_OR_NULL_PTR() should have never been added at the
first place, and the responsibility for checking should have been kept at
callers.

Too late for this now, yes.

--
Jiri Kosina
SUSE Labs


\
 
 \ /
  Last update: 2014-09-10 18:01    [W:0.100 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site