Skip to content

Commit

Permalink
module: potential uninitialized return in module_kallsyms_on_each_sym…
Browse files Browse the repository at this point in the history
…bol()

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: 013c166 ("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>
  • Loading branch information
Dan Carpenter authored and flaming-toast committed Feb 10, 2021
1 parent 3679482 commit 1e80d9c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 1e80d9c

Please sign in to comment.