[PATCH -next] mm/hugetlb_cgroup: register lockdep key for cftype

From: Xiu Jianfeng
Date: Mon Jun 17 2024 - 23:55:35 EST


The commit e18df2889ff9 ("mm/hugetlb_cgroup: prepare cftypes based on
template") has changed the cftypes from static allocated objects to
dynamic ones, so the cft->lockdep_key should be registered proactively.

Fixes: e18df2889ff9 ("mm/hugetlb_cgroup: prepare cftypes based on template")
Reported-by: kernel test robot <oliver.sang@xxxxxxxxx>
Closes: https://lore.kernel.org/oe-lkp/202406181046.8d8b2492-oliver.sang@xxxxxxxxx
Signed-off-by: Xiu Jianfeng <xiujianfeng@xxxxxxxxxx>
---
mm/hugetlb_cgroup.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/mm/hugetlb_cgroup.c b/mm/hugetlb_cgroup.c
index 2b899c4ae968..4ff238ba1250 100644
--- a/mm/hugetlb_cgroup.c
+++ b/mm/hugetlb_cgroup.c
@@ -836,6 +836,8 @@ hugetlb_cgroup_cfttypes_init(struct hstate *h, struct cftype *cft,
cft->file_offset = MEMFILE_OFFSET0(offset) +
MEMFILE_FIELD_SIZE(offset) * idx;
}
+
+ lockdep_register_key(&cft->lockdep_key);
}
}

--
2.34.1