From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: Georgi Djakov <georgi.djakov@linaro.org>
Cc: linux-kernel@vger.kernel.org,
"Gustavo A. R. Silva" <gustavo@embeddedor.com>
Subject: [PATCH] interconnect: core: Fix uninitialized variable
Date: Thu, 6 Sep 2018 09:34:21 -0500 [thread overview]
Message-ID: <20180906143421.GA3779@embeddedor.com> (raw)
There is a potential execution path in which variable *ret* is returned
without being properly initialized previously.
Fix this by initializing variable *ret* to -EINVAL.
Addresses-Coverity-ID: 1473202 ("Uninitialized scalar variable")
Fixes: 81b4cdb447fe ("interconnect: Add generic on-chip interconnect API")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/interconnect/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c
index 2740f1a..ea5245f 100644
--- a/drivers/interconnect/core.c
+++ b/drivers/interconnect/core.c
@@ -227,7 +227,7 @@ static int aggregate_requests(struct icc_node *node)
static int apply_constraints(struct icc_path *path)
{
struct icc_node *next, *prev = NULL;
- int ret;
+ int ret = -EINVAL;
int i;
for (i = 0; i < path->num_nodes; i++, prev = next) {
--
2.7.4
reply other threads:[~2018-09-06 14:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20180906143421.GA3779@embeddedor.com \
--to=gustavo@embeddedor.com \
--cc=georgi.djakov@linaro.org \
--cc=linux-kernel@vger.kernel.org \
/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
Powered by JetHome