Re: [RFC 0/4] CONFIG_STABLE to switch off development checks

Robert Hancock
2007-06-05T00:39:49Z

Dave Kleikamp wrote:
> I'm on Christoph's side here. I don't think it makes sense for any code
> to ask to allocate zero bytes of memory and expect valid memory to be
> returned.
>
> Would a compromise be to return a pointer to some known invalid region?
> This way the kmalloc(0) call would appear successful to the caller, but
> any access to the memory would result in an exception.

I would think returning 1 as the address would work here, it's not NULL
but any access to that page should still oops..

--
Robert Hancock Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/