Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 98072e4d authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by Pekka Enberg
Browse files

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: default avatarChristoph Lameter <cl@linux.com>
Signed-off-by: default avatarPavel Emelyanov <xemul@openvz.org>
Signed-off-by: default avatarPekka Enberg <penberg@kernel.org>
parent 716ce5d4
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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
@@ -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");
}