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 Tue, 9 Sep 2014, Andrew Morton wrote:

> >
> > - if (unlikely(ZERO_OR_NULL_PTR(objp)))
> > + if (unlikely(ZERO_OR_NULL_PTR(objp) || IS_ERR(objp)))
> > return;
>
> kfree() is quite a hot path to which this will add overhead. And we
> have (as far as we know) no code which will actually use this at
> present.

We could come up with a macro that does both. Basically if objp < 4086 or
so (signed comparison) then just return.



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