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 <[email protected]>
Signed-off-by: Pavel Emelyanov <[email protected]>
Signed-off-by: Pekka Enberg <[email protected]>
  • Loading branch information
xemul authored and penberg committed Nov 14, 2010
1 parent c8ddb27 commit 68cee4f
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 @@ -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
Expand Down Expand Up @@ -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");
}
Expand Down

0 comments on commit 68cee4f

Please sign in to comment.