[tip:x86/debug] x86: Remove weird PTR_ERR() in do_debug

From: tip-bot for Rusty Russell
Date: Wed Jun 19 2013 - 14:43:36 EST

Commit-ID: 5a802e15308f152247433d87050d1bfbf9613483
Gitweb: http://git.kernel.org/tip/5a802e15308f152247433d87050d1bfbf9613483
Author: Rusty Russell <rusty@xxxxxxxxxxxxxxx>
AuthorDate: Sun, 16 Jun 2013 14:12:47 +0930
Committer: Ingo Molnar <mingo@xxxxxxxxxx>
CommitDate: Wed, 19 Jun 2013 15:01:36 +0200

x86: Remove weird PTR_ERR() in do_debug

62edab905 changed the argument to notify_die() from dr6 to &dr6,
but weirdly, used PTR_ERR() to cast it to a long. Since dr6 is
on the stack, this is an abuse of PTR_ERR(). Cast to long, as
per kernel standard.

Signed-off-by: Rusty Russell <rusty@xxxxxxxxxxxxxxx>
Cc: K.Prasad <prasad@xxxxxxxxxxxxxxxxxx>
Link: http://lkml.kernel.org/r/1371357768-4968-8-git-send-email-rusty@xxxxxxxxxxxxxxx
Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
arch/x86/kernel/traps.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 772e2a8..9340dfb 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -437,7 +437,7 @@ dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code)
/* Store the virtualized DR6 value */
tsk->thread.debugreg6 = dr6;

- if (notify_die(DIE_DEBUG, "debug", regs, PTR_ERR(&dr6), error_code,
+ if (notify_die(DIE_DEBUG, "debug", regs, (long)&dr6, error_code,
goto exit;

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/