Skip to content

Commit

Permalink
slub: Fix slub_lock down/up imbalance
Browse files Browse the repository at this point in the history
There are two places, that do not release the slub_lock.

Respective bugs were introduced by sysfs changes ab4d5ed (slub: Enable
sysfs support for !CONFIG_SLUB_DEBUG) and 2bce648 ( 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>
  • Loading branch information
Pavel Emelyanov authored and Pekka Enberg committed Nov 6, 2010
1 parent 716ce5d commit 98072e4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -3289,9 +3289,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
Expand Down Expand Up @@ -3878,6 +3878,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");
}
Expand Down

0 comments on commit 98072e4

Please sign in to comment.