module_assert_mutex_or_preempt() is not needed in try_add_tainted_module(). The function checks for RCU-sched or the module_mutex to be acquired. The list_for_each_entry_rcu() below does the same check. Remove module_assert_mutex_or_preempt() from try_add_tainted_module().
Showing the changes to kernel/module (1 of 1 file). Show all
Unified · Split
| @@ -21,8 +21,6 @@ int try_add_tainted_module(struct module *mod) · 20 unmodified lines | ||
| 21 | 21 | { |
| 22 | 22 | struct mod_unload_taint *mod_taint; |
| 23 | 23 | |
| 24 | − module_assert_mutex_or_preempt(); | |
| 25 | − | |
| 26 | 24 | if (!mod->taints) |
| 27 | 25 | goto out; |
| 28 | 26 | |