From: Pavel Emelyanov Date: Thu, 28 Oct 2010 09:50:37 +0000 (+0400) Subject: slub: Fix slub_lock down/up imbalance X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=68cee4f118c21a1c67e5764a91d766661db5b360;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git slub: Fix slub_lock down/up imbalance There are two places, that do not release the slub_lock. Respective bugs were introduced by sysfs changes ab4d5ed5 (slub: Enable sysfs support for !CONFIG_SLUB_DEBUG) and 2bce6485 ( slub: Allow removal of slab caches during boot). Acked-by: Christoph Lameter Signed-off-by: Pavel Emelyanov Signed-off-by: Pekka Enberg --- diff --git a/mm/slub.c b/mm/slub.c index 8fd5401bb071..981fb730aa04 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -3273,9 +3273,9 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size, kfree(n); kfree(s); } +err: up_write(&slub_lock); -err: if (flags & SLAB_PANIC) panic("Cannot create slabcache %s\n", name); else @@ -3862,6 +3862,7 @@ static ssize_t show_slab_objects(struct kmem_cache *s, x += sprintf(buf + x, " N%d=%lu", node, nodes[node]); #endif + up_read(&slub_lock); kfree(nodes); return x + sprintf(buf + x, "\n"); }