summaryrefslogtreecommitdiff
path: root/kernel/module.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2021-02-10 13:57:07 +0300
committerJessica Yu <jeyu@kernel.org>2021-02-10 16:57:04 +0100
commit1e80d9cb579ed7edd121753eeccce82ff82521b4 (patch)
tree965ec6b2b7876dd172682b12be255c20dc092482 /kernel/module.c
parent367948220fcefcad1bf0d3d595a06efe0694acae (diff)
module: potential uninitialized return in module_kallsyms_on_each_symbol()
Smatch complains that: kernel/module.c:4472 module_kallsyms_on_each_symbol() error: uninitialized symbol 'ret'. This warning looks like it could be correct if the &modules list is empty. Fixes: 013c1667cf78 ("kallsyms: refactor {,module_}kallsyms_on_each_symbol") Reviewed-by: Miroslav Benes <mbenes@suse.cz> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jessica Yu <jeyu@kernel.org>
Diffstat (limited to 'kernel/module.c')
-rw-r--r--kernel/module.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/module.c b/kernel/module.c
index 93f360250bcb..30479355ab85 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -4388,7 +4388,7 @@ int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *,
{
struct module *mod;
unsigned int i;
- int ret;
+ int ret = 0;
mutex_lock(&module_mutex);
list_for_each_entry(mod, &modules, list) {