From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Date: Fri, 11 Mar 2016 08:07:47 +0000 Subject: [patch] kexec: potetially using uninitialized variable Message-Id: <20160311080747.GA31887@mwanda> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Andrew Morton , Vivek Goyal Cc: Dave Young , Xunlei Pang , Ingo Molnar , Toshi Kani , Mimi Zohar , Minfei Huang , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org 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 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;