diff options
author | mdf <mdf@FreeBSD.org> | 2010-10-19 16:06:00 +0000 |
---|---|---|
committer | mdf <mdf@FreeBSD.org> | 2010-10-19 16:06:00 +0000 |
commit | 3f66b926771c75cf92084431cf4f12eecfd68413 (patch) | |
tree | 831707880f4bd04c7cad195045b95a95f37ab310 /sys/vm | |
parent | f75a446d3c1a739748d2b754bed562e2fb1be7e2 (diff) | |
download | FreeBSD-src-3f66b926771c75cf92084431cf4f12eecfd68413.zip FreeBSD-src-3f66b926771c75cf92084431cf4f12eecfd68413.tar.gz |
uma_zfree(zone, NULL) should do nothing, to match free(9).
Noticed by: Ron Steinke <rsteinke at isilon dot com>
MFC after: 3 days
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/uma_core.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index dfd4403..43e3703 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -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); |