]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
x86: Remove weird PTR_ERR() in do_debug
authorRusty Russell <rusty@rustcorp.com.au>
Sun, 16 Jun 2013 04:42:47 +0000 (14:12 +0930)
committerIngo Molnar <mingo@kernel.org>
Wed, 19 Jun 2013 13:01:36 +0000 (15:01 +0200)
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@rustcorp.com.au>
Cc: K.Prasad <prasad@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/1371357768-4968-8-git-send-email-rusty@rustcorp.com.au
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/traps.c

index 772e2a846deca5a125e06a694a6dd3ae58ceb364..9340dfb7057fa3ef3204a9ff12a401dc48f591ed 100644 (file)
@@ -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,
                                                        SIGTRAP) == NOTIFY_STOP)
                goto exit;