sh: ptrace: remove a bogus check
Subsystems (3)
PATCH 1/1 sh: ptrace: remove a bogus check
We made "addr" unsigned back in 2010 in commit 9b05a69e0534 ("ptrace:
change signature of arch_ptrace()"). The check for negatives was always just a basic sanity check that duplicated other stricter checks, but now it causes static checker warnings so we should remove it.
Here is the Smatch warning for reference:
arch/sh/kernel/ptrace_64.c:399 arch_ptrace()
warn: unsigned 'addr' is never less than zero.
Signed-off-by Dan Carpenter <[email protected]>
arch/sh/kernel/ptrace_64.c +2 -2
@@ -396,7 +396,7 @@ long arch_ptrace(struct task_struct *child, long request,unsigned long tmp; ret = -EIO ; -if ((addr &3 ) || addr <0 ) +if (addr &3 )break ;if (addr <sizeof (struct pt_regs ))
@@ -424,7 +424,7 @@ long arch_ptrace(struct task_struct *child, long request,this could crash the kernel or result in a security loophole. */ ret = -EIO ; -if ((addr &3 ) || addr <0 ) +if (addr &3 )break ;if (addr <sizeof (struct pt_regs )) {