Skip to content

Commit a931dd3

Browse files
committed
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
2 parents 1423e26 + 2c0f0f3 commit a931dd3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

kernel/module.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,8 +1018,7 @@ void __symbol_put(const char *symbol)
10181018
};
10191019

10201020
preempt_disable();
1021-
if (!find_symbol(&fsa))
1022-
BUG();
1021+
BUG_ON(!find_symbol(&fsa));
10231022
module_put(fsa.owner);
10241023
preempt_enable();
10251024
}
@@ -4425,9 +4424,10 @@ int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *,
44254424
ret = fn(data, kallsyms_symbol_name(kallsyms, i),
44264425
mod, kallsyms_symbol_value(sym));
44274426
if (ret != 0)
4428-
break;
4427+
goto out;
44294428
}
44304429
}
4430+
out:
44314431
mutex_unlock(&module_mutex);
44324432
return ret;
44334433
}

0 commit comments

Comments
 (0)