Print this page
11927 Log, or optionally panic, on zero-length kmem allocations
Reviewed by: Dan McDonald <danmcd@joyent.com>
Reviewed by: Jason King <jason.brian.king@gmail.com>

*** 98,107 **** garbage. This random garbage may include secure kernel data. Therefore, uninitialized kernel memory should be handled carefully. For example, never copyout(9F) a potentially uninitialized buffer. NOTES ! kmem_alloc(0, flag) always returns NULL. kmem_free(NULL, 0) is legal. ! October 22, 2014 KMEM_ALLOC(9F) --- 98,110 ---- garbage. This random garbage may include secure kernel data. Therefore, uninitialized kernel memory should be handled carefully. For example, never copyout(9F) a potentially uninitialized buffer. NOTES ! kmem_alloc(0, flag) always returns NULL, but if KM_SLEEP is set, this ! behavior is considered to be deprecated; the system may be configured ! to explicitly panic in this case in lieu of returning NULL. ! kmem_free(NULL, 0) is legal, however. ! November 20, 2019 KMEM_ALLOC(9F)