|
@@ -3082,27 +3082,19 @@ long arch_ptrace(struct task_struct *child, long request,
|
|
|
#endif /* CONFIG_HAVE_HW_BREAKPOINT */
|
|
|
#endif /* CONFIG_PPC_ADV_DEBUG_REGS */
|
|
|
|
|
|
- if (!access_ok(VERIFY_WRITE, datavp,
|
|
|
- sizeof(struct ppc_debug_info)))
|
|
|
+ if (copy_to_user(datavp, &dbginfo,
|
|
|
+ sizeof(struct ppc_debug_info)))
|
|
|
return -EFAULT;
|
|
|
- ret = __copy_to_user(datavp, &dbginfo,
|
|
|
- sizeof(struct ppc_debug_info)) ?
|
|
|
- -EFAULT : 0;
|
|
|
- break;
|
|
|
+ return 0;
|
|
|
}
|
|
|
|
|
|
case PPC_PTRACE_SETHWDEBUG: {
|
|
|
struct ppc_hw_breakpoint bp_info;
|
|
|
|
|
|
- if (!access_ok(VERIFY_READ, datavp,
|
|
|
- sizeof(struct ppc_hw_breakpoint)))
|
|
|
+ if (copy_from_user(&bp_info, datavp,
|
|
|
+ sizeof(struct ppc_hw_breakpoint)))
|
|
|
return -EFAULT;
|
|
|
- ret = __copy_from_user(&bp_info, datavp,
|
|
|
- sizeof(struct ppc_hw_breakpoint)) ?
|
|
|
- -EFAULT : 0;
|
|
|
- if (!ret)
|
|
|
- ret = ppc_set_hwdebug(child, &bp_info);
|
|
|
- break;
|
|
|
+ return ppc_set_hwdebug(child, &bp_info);
|
|
|
}
|
|
|
|
|
|
case PPC_PTRACE_DELHWDEBUG: {
|