Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eb5a3699 authored by Namhyung Kim's avatar Namhyung Kim Committed by Linus Torvalds
Browse files

ptrace: cleanup arch_ptrace() on x86



Remove checking @addr less than 0 because @addr is now unsigned and
use new udescp variable in order to remove unnecessary castings.

[akpm@linux-foundation.org: fix unused variable 'udescp']
Signed-off-by: default avatarNamhyung Kim <namhyung@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 9b05a69e
Loading
Loading
Loading
Loading
+4 −6
Original line number Original line Diff line number Diff line
@@ -813,8 +813,7 @@ long arch_ptrace(struct task_struct *child, long request,
		unsigned long tmp;
		unsigned long tmp;


		ret = -EIO;
		ret = -EIO;
		if ((addr & (sizeof(data) - 1)) || addr < 0 ||
		if ((addr & (sizeof(data) - 1)) || addr >= sizeof(struct user))
		    addr >= sizeof(struct user))
			break;
			break;


		tmp = 0;  /* Default return condition */
		tmp = 0;  /* Default return condition */
@@ -831,8 +830,7 @@ long arch_ptrace(struct task_struct *child, long request,


	case PTRACE_POKEUSR: /* write the word at location addr in the USER area */
	case PTRACE_POKEUSR: /* write the word at location addr in the USER area */
		ret = -EIO;
		ret = -EIO;
		if ((addr & (sizeof(data) - 1)) || addr < 0 ||
		if ((addr & (sizeof(data) - 1)) || addr >= sizeof(struct user))
		    addr >= sizeof(struct user))
			break;
			break;


		if (addr < sizeof(struct user_regs_struct))
		if (addr < sizeof(struct user_regs_struct))