diff --git a/kernel/module.c b/kernel/module.c index 7f21ab238aa7b28e5f89064d3fa17801d2d519fe..beaebea627ff50ceb82fed00284f1e1887870961 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -264,7 +264,7 @@ static void module_assert_mutex_or_preempt(void) if (unlikely(!debug_locks)) return; - WARN_ON(!rcu_read_lock_sched_held() && + WARN_ON_ONCE(!rcu_read_lock_sched_held() && !lockdep_is_held(&module_mutex)); #endif }