Commit 98072e4d977aabe6a39abb95951cd8bf2c2202d5

Authored by Pavel Emelyanov
Committed by Pekka Enberg
1 parent 716ce5d4a6

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 <cl@linux.com>
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: Pekka Enberg <penberg@kernel.org>

Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff

... ... @@ -3289,9 +3289,9 @@
3289 3289 kfree(n);
3290 3290 kfree(s);
3291 3291 }
  3292 +err:
3292 3293 up_write(&slub_lock);
3293 3294  
3294   -err:
3295 3295 if (flags & SLAB_PANIC)
3296 3296 panic("Cannot create slabcache %s\n", name);
3297 3297 else
... ... @@ -3878,6 +3878,7 @@
3878 3878 x += sprintf(buf + x, " N%d=%lu",
3879 3879 node, nodes[node]);
3880 3880 #endif
  3881 + up_read(&slub_lock);
3881 3882 kfree(nodes);
3882 3883 return x + sprintf(buf + x, "\n");
3883 3884 }