DEFINE_CTL_TABLE_POLL() statically initializes an embedded wait queue. An automatic local poll object cannot provide the persistent lockdep class key expected by its wait queue lock. Add ASSERT_STATIC_STORAGE() to reject automatic declarations while preserving file-scope and static local definitions. Leave the underlying initializer available for embedded objects. Assisted-by: OpenAI Codex Signed-off-by: Yury Norov --- include/linux/sysctl.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index e5d7226ab6f5..be79359346af 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -22,6 +22,7 @@ #ifndef _LINUX_SYSCTL_H #define _LINUX_SYSCTL_H +#include #include #include #include @@ -216,7 +217,8 @@ static inline void *proc_sys_poll_event(struct ctl_table_poll *poll) .wait = __WAIT_QUEUE_HEAD_INITIALIZER(name.wait) } #define DEFINE_CTL_TABLE_POLL(name) \ - struct ctl_table_poll name = __CTL_TABLE_POLL_INITIALIZER(name) + struct ctl_table_poll name = __CTL_TABLE_POLL_INITIALIZER(name); \ + ASSERT_STATIC_STORAGE(name) /* A sysctl table is an array of struct ctl_table: */ struct ctl_table { -- 2.53.0