diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2021-07-07 11:41:32 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2021-07-07 11:41:32 -0700 |
commit | a931dd33d370896a683236bba67c0d6f3d01144d (patch) | |
tree | 3301e438a0575cfd6d9fae1b5001da8babc390bd /kernel/module.c | |
parent | 1423e2660cf134a8f21f2451865a04792013e49e (diff) | |
parent | 2c0f0f3639562d6e38ee9705303c6457c4936eac (diff) | |
download | linux-a931dd33d370896a683236bba67c0d6f3d01144d.tar.bz2 |
Merge tag 'modules-for-v5.14' of git://git.kernel.org/pub/scm/linux/kernel/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
Diffstat (limited to 'kernel/module.c')
-rw-r--r-- | kernel/module.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/module.c b/kernel/module.c index 927d46cb8eb9..64bd61b2d3ad 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -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(); } @@ -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; } |