Skip to content

Commit

Permalink
Merge tag 'modules-for-v5.14' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/git/jeyu/linux

Pull module updates from Jessica Yu:

 - Fix incorrect logic in module_kallsyms_on_each_symbol()

 - Fix for a Coccinelle warning

* tag 'modules-for-v5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux:
  module: correctly exit module_kallsyms_on_each_symbol when fn() != 0
  kernel/module: Use BUG_ON instead of if condition followed by BUG
  • Loading branch information
torvalds committed Jul 7, 2021
2 parents 1423e26 + 2c0f0f3 commit a931dd3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1018,8 +1018,7 @@ void __symbol_put(const char *symbol)
};

preempt_disable();
if (!find_symbol(&fsa))
BUG();
BUG_ON(!find_symbol(&fsa));
module_put(fsa.owner);
preempt_enable();
}
Expand Down Expand Up @@ -4425,9 +4424,10 @@ int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *,
ret = fn(data, kallsyms_symbol_name(kallsyms, i),
mod, kallsyms_symbol_value(sym));
if (ret != 0)
break;
goto out;
}
}
out:
mutex_unlock(&module_mutex);
return ret;
}
Expand Down

0 comments on commit a931dd3

Please sign in to comment.