uma_zfree(zone, NULL) should do nothing, to match free(9).
Noticed by: Ron Steinke <rsteinke at isilon dot com> MFC after: 3 days
This commit is contained in:
parent
f75a446d3c
commit
3f66b92677
@ -153,6 +153,13 @@ Items are released back to the zone from which they were allocated by
|
||||
calling
|
||||
.Fn uma_zfree
|
||||
with a pointer to the zone and a pointer to the item.
|
||||
If
|
||||
.Fa item
|
||||
is
|
||||
.Dv NULL ,
|
||||
then
|
||||
.Fn uma_zfree
|
||||
does nothing.
|
||||
.Pp
|
||||
The variations
|
||||
.Fn uma_zalloc_arg
|
||||
|
@ -2517,6 +2517,10 @@ uma_zfree_arg(uma_zone_t zone, void *item, void *udata)
|
||||
CTR2(KTR_UMA, "uma_zfree_arg thread %x zone %s", curthread,
|
||||
zone->uz_name);
|
||||
|
||||
/* uma_zfree(..., NULL) does nothing, to match free(9). */
|
||||
if (item == NULL)
|
||||
return;
|
||||
|
||||
if (zone->uz_dtor)
|
||||
zone->uz_dtor(item, zone->uz_size, udata);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user