lkml.org 
[lkml]   [2010]   [Feb]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC][PATCH] mm: Remove ZERO_SIZE_PTR.
From
Date
Christoph Lameter wrote:
> On Fri, 26 Feb 2010, Tetsuo Handa wrote:
>
> > Everybody should check for ptr != NULL, and most callers are actually checking
> > for ptr != NULL. But nobody is checking for ptr != ZERO_SIZE_PTR.
>
> That is so intentionally because some kernel subsystem can do a zero size
> allocation.
>
So, not only users *can* do zero size allocation,
but also there *are* users who are intentionally doing zero size allocation.
Then, we can't remove ZERO_SIZE_PTR.

> > Yes, this is the fault of caller. But ZERO_SIZE_PTR is too small value to
> > distinguish "NULL pointer dereference" and "ZERO_SIZE_PTR dereference" because
> > address printed by oops message can easily exceed ZERO_SIZE_PTR when
> > "struct foo" is large.
>
> Correct.

Maybe PAGE_SIZE / 2 is better than 16?

Thanks.


\
 
 \ /
  Last update: 2010-02-27 02:03    [W:0.908 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site