public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86, vsyscall: Fix build warning in vsyscall_64.c
@ 2011-06-11  7:31 Rakib Mullick
  2011-06-11 11:01 ` Andrew Lutomirski
  0 siblings, 1 reply; 25+ messages in thread
From: Rakib Mullick @ 2011-06-11  7:31 UTC (permalink / raw)
  To: mingo; +Cc: hpa, tglx, luto, x86, linux-kernel

Due to commit 5cec93c216db77 (x86-64: Emulate legacy vsyscalls), we get the following warning:

   arch/x86/kernel/vsyscall_64.c: In function ‘do_emulate_vsyscall’:
   arch/x86/kernel/vsyscall_64.c:111:7: warning: ‘ret’ may be used uninitialized in this function

The uninitialized value of 'ret' maybe gets assigned to regs->ax. So, initialize it with -EINVAL.

Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>
---

diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c
index 10cd8ac..180c56d 100644
--- a/arch/x86/kernel/vsyscall_64.c
+++ b/arch/x86/kernel/vsyscall_64.c
@@ -108,7 +108,7 @@ void dotraplinkage do_emulate_vsyscall(struct pt_regs *regs, long error_code)
 	struct task_struct *tsk;
 	unsigned long caller;
 	int vsyscall_nr;
-	long ret;
+	long ret = -EINVAL;
 
 	/* Kernel code must never get here. */
 	BUG_ON(!user_mode(regs));
@@ -163,7 +163,7 @@ void dotraplinkage do_emulate_vsyscall(struct pt_regs *regs, long error_code)
 		BUG();
 	}
 
-	if (ret == -EFAULT) {
+	if (ret == -EFAULT || ret == -EINVAL) {
 		/*
 		 * Bad news -- userspace fed a bad pointer to a vsyscall.
 		 *



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

end of thread, other threads:[~2011-06-15 19:52 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-11  7:31 [PATCH] x86, vsyscall: Fix build warning in vsyscall_64.c Rakib Mullick
2011-06-11 11:01 ` Andrew Lutomirski
2011-06-12  5:12   ` Rakib Mullick
2011-06-13  2:52     ` Andrew Lutomirski
2011-06-13  4:54       ` Rakib Mullick
2011-06-13  8:45         ` Rakib Mullick
2011-06-13 18:06           ` Andrew Lutomirski
2011-06-14 17:43             ` Rakib Mullick
2011-06-14 18:03               ` Andy Lutomirski
2011-06-14 21:16                 ` Ingo Molnar
2011-06-14 21:24                   ` Linus Torvalds
2011-06-14 21:31                     ` Ingo Molnar
2011-06-14 21:33                       ` Andrew Lutomirski
2011-06-15  5:59                         ` Rakib Mullick
2011-06-15  7:25                           ` Ingo Molnar
2011-06-15 18:49                             ` Linus Torvalds
2011-06-15 19:24                               ` Andrew Lutomirski
2011-06-15 19:32                                 ` Linus Torvalds
2011-06-15 19:51                                   ` Andrew Lutomirski
2011-06-13  9:29   ` Ingo Molnar
2011-06-13 13:03     ` Andrew Lutomirski
2011-06-13 14:14       ` Ingo Molnar
2011-06-13 14:18         ` Andrew Lutomirski
2011-06-13 17:05           ` Rakib Mullick
2011-06-13 17:06             ` Andrew Lutomirski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox