[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1307777464.25182.3.camel@localhost.localdomain>
Date: Sat, 11 Jun 2011 13:31:04 +0600
From: Rakib Mullick <rakib.mullick@...il.com>
To: mingo@...e.hu
Cc: hpa@...or.com, tglx@...utronix.de, luto@....edu, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] x86, vsyscall: Fix build warning in vsyscall_64.c
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@...il.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.
*
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists