forked from Minki/linux
slub: Fix slub_lock down/up imbalance
There are two places, that do not release the slub_lock. Respective bugs were introduced by sysfs changesab4d5ed5
(slub: Enable sysfs support for !CONFIG_SLUB_DEBUG) and2bce6485
( 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>
This commit is contained in:
parent
c8ddb2713c
commit
68cee4f118
@ -3273,9 +3273,9 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size,
|
|||||||
kfree(n);
|
kfree(n);
|
||||||
kfree(s);
|
kfree(s);
|
||||||
}
|
}
|
||||||
|
err:
|
||||||
up_write(&slub_lock);
|
up_write(&slub_lock);
|
||||||
|
|
||||||
err:
|
|
||||||
if (flags & SLAB_PANIC)
|
if (flags & SLAB_PANIC)
|
||||||
panic("Cannot create slabcache %s\n", name);
|
panic("Cannot create slabcache %s\n", name);
|
||||||
else
|
else
|
||||||
@ -3862,6 +3862,7 @@ static ssize_t show_slab_objects(struct kmem_cache *s,
|
|||||||
x += sprintf(buf + x, " N%d=%lu",
|
x += sprintf(buf + x, " N%d=%lu",
|
||||||
node, nodes[node]);
|
node, nodes[node]);
|
||||||
#endif
|
#endif
|
||||||
|
up_read(&slub_lock);
|
||||||
kfree(nodes);
|
kfree(nodes);
|
||||||
return x + sprintf(buf + x, "\n");
|
return x + sprintf(buf + x, "\n");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user