diff options
-rw-r--r-- | sys/vm/uma_core.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index a6bb05e..47daeee 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -513,10 +513,12 @@ cache_drain(uma_zone_t zone, int destroy) bucket_drain(zone, cache->uc_allocbucket); bucket_drain(zone, cache->uc_freebucket); if (destroy) { - uma_zfree_internal(bucketzone, cache->uc_allocbucket, - NULL, 0); - uma_zfree_internal(bucketzone, cache->uc_freebucket, - NULL, 0); + if (cache->uc_allocbucket != NULL) + uma_zfree_internal(bucketzone, + cache->uc_allocbucket, NULL, 0); + if (cache->uc_freebucket != NULL) + uma_zfree_internal(bucketzone, + cache->uc_freebucket, NULL, 0); cache->uc_allocbucket = cache->uc_freebucket = NULL; } } |