diff options
author | bmilekic <bmilekic@FreeBSD.org> | 2003-08-01 17:42:27 +0000 |
---|---|---|
committer | bmilekic <bmilekic@FreeBSD.org> | 2003-08-01 17:42:27 +0000 |
commit | 9caa205e5b4234ff1a448a268c9e8554ef24375c (patch) | |
tree | c69d21ba23dcef88cb0f837312f2bbf60d20c917 | |
parent | a8a8a6510a1ac447b83ccfaf699d87d95be84c96 (diff) | |
download | FreeBSD-src-9caa205e5b4234ff1a448a268c9e8554ef24375c.zip FreeBSD-src-9caa205e5b4234ff1a448a268c9e8554ef24375c.tar.gz |
Only free the pcpu cache buckets if they are non-NULL.
Crashed this person's machine: harti
Pointy-hat to: me
-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; } } |