summaryrefslogtreecommitdiff
path: root/kern
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2013-04-21 00:58:54 +0200
committerRichard Braun <rbraun@sceen.net>2013-04-21 00:58:54 +0200
commitb54c7e38d8871a0c8b7694e7fd02062cf7ca988a (patch)
tree37da0a04bd95202082e9609fd8beef8b1cdabe7c /kern
parent8c8fa10a6146cf3cd0d473b38ced2fc99ad935fe (diff)
Fix locking error in the slab allocator
* kern/slab.c (kmem_cache_free): Lock cache before releasing an object to the slab layer.
Diffstat (limited to 'kern')
-rw-r--r--kern/slab.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kern/slab.c b/kern/slab.c
index 99d5bca..3db4db1 100644
--- a/kern/slab.c
+++ b/kern/slab.c
@@ -1305,7 +1305,9 @@ fast_free:
slab_free:
#endif /* SLAB_USE_CPU_POOLS */
+ simple_lock(&cache->lock);
kmem_cache_free_to_slab(cache, (void *)obj);
+ simple_unlock(&cache->lock);
}
void slab_collect(void)