DragonFly kernel List (threaded) for 2007-02
DragonFly BSD
DragonFly kernel List (threaded) for 2007-02
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: missing error check in lwkt_alloc_thread


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Fri, 23 Feb 2007 10:43:00 -0800 (PST)

    Update to my last comment:  We already have a kmem_alloc3() procedure
    which takes kmflags.

    So I suggest we add a KM_NULLOK flag and add code to kmem_alloc3() to
    panic if it is unable to allocate memory and KM_NULLOK was not passed 
    to it.

    kmem_alloc() is an inline function which just calls kmem_alloc3(..., 0),
    so it would not have to be changed.  Changing kmem_alloc3() to add this
    flag would cause kmem_alloc()'s semantics to change to 'panic instead of
    return NULL'.

    All callers of kmem_alloc() would have to be vetted and those cases 
    where it is ok to return NULL would be changed to a kmem_alloc3() call
    that passes KM_NULLOK.

						-Matt



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