aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/fault.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2019-06-03 10:23:58 -0500
committerEric W. Biederman <ebiederm@xmission.com>2019-06-03 10:23:58 -0500
commit318759b4737c3b3789e2fd64d539f437d52386f5 (patch)
tree80b6b478a49501eb8923a747159288eef8b79d97 /arch/x86/mm/fault.c
parentsignal: Remove the signal number and task parameters from force_sig_info (diff)
downloadlinux-dev-318759b4737c3b3789e2fd64d539f437d52386f5.tar.xz
linux-dev-318759b4737c3b3789e2fd64d539f437d52386f5.zip
signal/x86: Move tsk inside of CONFIG_MEMORY_FAILURE in do_sigbus
Stephen Rothwell <sfr@canb.auug.org.au> reported: > After merging the userns tree, today's linux-next build (i386 defconfig) > produced this warning: > > arch/x86/mm/fault.c: In function 'do_sigbus': > arch/x86/mm/fault.c:1017:22: warning: unused variable 'tsk' [-Wunused-variable] > struct task_struct *tsk = current; > ^~~ > > Introduced by commit > > 351b6825b3a9 ("signal: Explicitly call force_sig_fault on current") > > The remaining used of "tsk" are protected by CONFIG_MEMORY_FAILURE. So do the obvious thing and move tsk inside of CONFIG_MEMORY_FAILURE to prevent introducing new warnings into the build. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'arch/x86/mm/fault.c')
-rw-r--r--arch/x86/mm/fault.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 46ac96aa7c81..fb4e39c4e0a9 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -1014,8 +1014,6 @@ static void
do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address,
vm_fault_t fault)
{
- struct task_struct *tsk = current;
-
/* Kernel mode? Handle exceptions or die: */
if (!(error_code & X86_PF_USER)) {
no_context(regs, error_code, address, SIGBUS, BUS_ADRERR);
@@ -1030,6 +1028,7 @@ do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address,
#ifdef CONFIG_MEMORY_FAILURE
if (fault & (VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE)) {
+ struct task_struct *tsk = current;
unsigned lsb = 0;
pr_err(