mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
PTRACE_PEEKDATA consolidation
Identical implementations of PTRACE_PEEKDATA go into generic_ptrace_peekdata() function. Signed-off-by: Alexey Dobriyan <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
bcdcd8e725
commit
7664732315
21 changed files with 43 additions and 166 deletions
|
|
@ -490,3 +490,14 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
|
|||
return ret;
|
||||
}
|
||||
#endif /* __ARCH_SYS_PTRACE */
|
||||
|
||||
int generic_ptrace_peekdata(struct task_struct *tsk, long addr, long data)
|
||||
{
|
||||
unsigned long tmp;
|
||||
int copied;
|
||||
|
||||
copied = access_process_vm(tsk, addr, &tmp, sizeof(tmp), 0);
|
||||
if (copied != sizeof(tmp))
|
||||
return -EIO;
|
||||
return put_user(tmp, (unsigned long __user *)data);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue