diff options
author | Mike Rapoport <rppt@linux.vnet.ibm.com> | 2018-02-06 18:40:17 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-02-06 21:32:46 -0500 |
commit | 2ee0826085d1c0281cb60c1f4bc3e0c27efeedc3 (patch) | |
tree | bb2dc8915be7e4f0fea7438edf380d84b896f80a /mm/process_vm_access.c | |
parent | eab216e9cc636c24cec06bdf57a80f4c26b34493 (diff) |
pids: introduce find_get_task_by_vpid() helper
There are several functions that do find_task_by_vpid() followed by
get_task_struct(). We can use a helper function instead.
Link: http://lkml.kernel.org/r/1509602027-11337-1-git-send-email-rppt@linux.vnet.ibm.com
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/process_vm_access.c')
-rw-r--r-- | mm/process_vm_access.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/mm/process_vm_access.c b/mm/process_vm_access.c index 8973cd231ece..16424b9ae424 100644 --- a/mm/process_vm_access.c +++ b/mm/process_vm_access.c | |||
@@ -197,11 +197,7 @@ static ssize_t process_vm_rw_core(pid_t pid, struct iov_iter *iter, | |||
197 | } | 197 | } |
198 | 198 | ||
199 | /* Get process information */ | 199 | /* Get process information */ |
200 | rcu_read_lock(); | 200 | task = find_get_task_by_vpid(pid); |
201 | task = find_task_by_vpid(pid); | ||
202 | if (task) | ||
203 | get_task_struct(task); | ||
204 | rcu_read_unlock(); | ||
205 | if (!task) { | 201 | if (!task) { |
206 | rc = -ESRCH; | 202 | rc = -ESRCH; |
207 | goto free_proc_pages; | 203 | goto free_proc_pages; |