summaryrefslogtreecommitdiff
path: root/mm/slab_common.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-17 09:44:25 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-17 09:44:25 +0200
commit0e9e37d042b1fc506287fceb939a35c35d610bf4 (patch)
tree5a87a8d81f3d44fec237efb6120216c199b15eae /mm/slab_common.c
parent5c3e241f5246445da29bd03783ca61a18face968 (diff)
parentd07f6ca923ea0927a1024dfccafc5b53b61cfecc (diff)
Merge 5.13-rc2 into driver-core-next
We need the driver core fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm/slab_common.c')
-rw-r--r--mm/slab_common.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c
index f8833d3e5d47..a4a571428c51 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -318,6 +318,16 @@ kmem_cache_create_usercopy(const char *name,
const char *cache_name;
int err;
+#ifdef CONFIG_SLUB_DEBUG
+ /*
+ * If no slub_debug was enabled globally, the static key is not yet
+ * enabled by setup_slub_debug(). Enable it if the cache is being
+ * created with any of the debugging flags passed explicitly.
+ */
+ if (flags & SLAB_DEBUG_FLAGS)
+ static_branch_enable(&slub_debug_enabled);
+#endif
+
mutex_lock(&slab_mutex);
err = kmem_cache_sanity_check(name, size);