tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kmem_alloc(0, f)



On Sun, Jul 30, 2017 at 03:23:50PM -0000, Michael van Elst wrote:
> martin%duskware.de@localhost (Martin Husemann) writes:
> 
> >On Sat, Jul 29, 2017 at 02:04:42PM +0000, Taylor R Campbell wrote:
> >> This seems like a foot-oriented panic gun, and it's been a source of
> >> problems in the past.  Can we change it?
> 
> >I think it is a valuable tool to catch driver bugs early during
> >developement, but wouldn't mind to reduce it to a KASSERT.
> 
> So what does kmem_alloc(0, KM_SLEEP) do? fail where KM_SLEEP says it
> cannot fail? I don't think that it can return a zero sized allocation
> (i.e. ptr != NULL that cannot be dereferenced).

Just return a NULL pointer? That said, I do prefer just declaring it
invalid...

Joerg


Home | Main Index | Thread Index | Old Index