Only free the pcpu cache buckets if they are non-NULL.

Crashed this person's machine: harti
Pointy-hat to: me
This commit is contained in:
Bosko Milekic 2003-08-01 17:42:27 +00:00
parent 515d4440fe
commit 174ab4501e

View File

@ -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;
}
}