* [PATCH] interconnect: core: Fix uninitialized variable
@ 2018-09-06 14:34 Gustavo A. R. Silva
0 siblings, 0 replies; only message in thread
From: Gustavo A. R. Silva @ 2018-09-06 14:34 UTC (permalink / raw)
To: Georgi Djakov; +Cc: linux-kernel, Gustavo A. R. Silva
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-09-06 14:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-06 14:34 [PATCH] interconnect: core: Fix uninitialized variable Gustavo A. R. Silva
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).