From: Dan Carpenter <dan.carpenter@oracle.com>
To: Andrew Morton <akpm@linux-foundation.org>,
Vivek Goyal <vgoyal@redhat.com>
Cc: Dave Young <dyoung@redhat.com>, Xunlei Pang <xlpang@redhat.com>,
Ingo Molnar <mingo@kernel.org>, Toshi Kani <toshi.kani@hpe.com>,
Mimi Zohar <zohar@linux.vnet.ibm.com>,
Minfei Huang <mnfhuang@gmail.com>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] kexec: potetially using uninitialized variable
Date: Fri, 11 Mar 2016 11:07:47 +0300 [thread overview]
Message-ID: <20160311080747.GA31887@mwanda> (raw)
At the end of the function we check if "ret" has a negative error code,
but it seems possible that it is uninitialized.
Fixes: 12db5562e035 ('kexec: load and relocate purgatory at kernel load time')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c
index 503bc2d..63d1af3 100644
--- a/kernel/kexec_file.c
+++ b/kernel/kexec_file.c
@@ -795,7 +795,7 @@ out:
static int kexec_apply_relocations(struct kimage *image)
{
- int i, ret;
+ int i, ret = 0;
struct purgatory_info *pi = &image->purgatory_info;
Elf_Shdr *sechdrs = pi->sechdrs;
next reply other threads:[~2016-03-11 8:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-11 8:07 Dan Carpenter [this message]
2016-03-11 8:52 ` [patch] kexec: potetially using uninitialized variable Xunlei Pang
2016-03-11 9:19 ` Dan Carpenter
2016-03-11 9:47 ` walter harms
2016-03-11 15:38 ` Minfei Huang
2016-03-14 10:58 ` Dan Carpenter
2016-03-14 11:25 ` Minfei Huang
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=20160311080747.GA31887@mwanda \
--to=dan.carpenter@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=dyoung@redhat.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mnfhuang@gmail.com \
--cc=toshi.kani@hpe.com \
--cc=vgoyal@redhat.com \
--cc=xlpang@redhat.com \
--cc=zohar@linux.vnet.ibm.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