linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] kexec: potetially using uninitialized variable
@ 2016-03-11  8:07 Dan Carpenter
  2016-03-11  8:52 ` Xunlei Pang
  0 siblings, 1 reply; 7+ messages in thread
From: Dan Carpenter @ 2016-03-11  8:07 UTC (permalink / raw)
  To: Andrew Morton, Vivek Goyal
  Cc: Dave Young, Xunlei Pang, Ingo Molnar, Toshi Kani, Mimi Zohar,
	Minfei Huang, linux-kernel, kernel-janitors

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;
 

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-03-14 11:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-11  8:07 [patch] kexec: potetially using uninitialized variable Dan Carpenter
2016-03-11  8:52 ` 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

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).