aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/kernel/traps.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/kernel/traps.c')
-rw-r--r--arch/x86_64/kernel/traps.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c
index 1a9094dab682..8d21d87b0d77 100644
--- a/arch/x86_64/kernel/traps.c
+++ b/arch/x86_64/kernel/traps.c
@@ -726,11 +726,9 @@ asmlinkage void __kprobes do_debug(struct pt_regs * regs,
726 info.si_signo = SIGTRAP; 726 info.si_signo = SIGTRAP;
727 info.si_errno = 0; 727 info.si_errno = 0;
728 info.si_code = TRAP_BRKPT; 728 info.si_code = TRAP_BRKPT;
729 if (!user_mode(regs)) 729 info.si_addr = user_mode(regs) ? (void __user *)regs->rip : NULL;
730 goto clear_dr7; 730 force_sig_info(SIGTRAP, &info, tsk);
731 731
732 info.si_addr = (void __user *)regs->rip;
733 force_sig_info(SIGTRAP, &info, tsk);
734clear_dr7: 732clear_dr7:
735 set_debugreg(0UL, 7); 733 set_debugreg(0UL, 7);
736 return; 734 return;