PTRACE_PEEKDATA consolidation
[firefly-linux-kernel-4.4.55.git] / arch / frv / kernel / ptrace.c
index ce88fb95ee59e5ce213d3c4a660e27e3fe9b4cbf..a10f3092fad4b2f535f38c87ce57afae4cfc4b89 100644 (file)
@@ -112,20 +112,12 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
        switch (request) {
                /* when I and D space are separate, these will need to be fixed. */
        case PTRACE_PEEKTEXT: /* read word at location addr. */
-       case PTRACE_PEEKDATA: {
-               int copied;
-
+       case PTRACE_PEEKDATA:
                ret = -EIO;
                if (is_user_addr_valid(child, addr, sizeof(tmp)) < 0)
                        break;
-
-               copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0);
-               if (copied != sizeof(tmp))
-                       break;
-
-               ret = put_user(tmp,(unsigned long *) data);
+               ret = generic_ptrace_peekdata(child, addr, data);
                break;
-       }
 
                /* read the word at location addr in the USER area. */
        case PTRACE_PEEKUSR: {