From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jessica Yu <jeyu@kernel.org>, Christoph Hellwig <hch@lst.de>
Cc: Petr Mladek <pmladek@suse.com>, Miroslav Benes <mbenes@suse.cz>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] module: potential uninitialized return in module_kallsyms_on_each_symbol()
Date: Wed, 10 Feb 2021 13:57:07 +0300 [thread overview]
Message-ID: <YCO8AwE57IzaMamG@mwanda> (raw)
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")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
kernel/module.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/module.c b/kernel/module.c
index 95186c9d81ea..9bd3c821d029 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -4447,7 +4447,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) {
--
2.30.0
next reply other threads:[~2021-02-10 11:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-10 10:57 Dan Carpenter [this message]
2021-02-10 11:59 ` [PATCH] module: potential uninitialized return in module_kallsyms_on_each_symbol() Christoph Hellwig
2021-02-10 12:08 ` Miroslav Benes
2021-02-10 16:17 ` Jessica Yu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YCO8AwE57IzaMamG@mwanda \
--to=dan.carpenter@oracle.com \
--cc=hch@lst.de \
--cc=jeyu@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mbenes@suse.cz \
--cc=pmladek@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox