aboutsummaryrefslogtreecommitdiffstats
path: root/mm/process_vm_access.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/process_vm_access.c')
-rw-r--r--mm/process_vm_access.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/mm/process_vm_access.c b/mm/process_vm_access.c
index 8973cd231ece..a447092d4635 100644
--- a/mm/process_vm_access.c
+++ b/mm/process_vm_access.c
@@ -25,7 +25,7 @@
25/** 25/**
26 * process_vm_rw_pages - read/write pages from task specified 26 * process_vm_rw_pages - read/write pages from task specified
27 * @pages: array of pointers to pages we want to copy 27 * @pages: array of pointers to pages we want to copy
28 * @start_offset: offset in page to start copying from/to 28 * @offset: offset in page to start copying from/to
29 * @len: number of bytes to copy 29 * @len: number of bytes to copy
30 * @iter: where to copy to/from locally 30 * @iter: where to copy to/from locally
31 * @vm_write: 0 means copy from, 1 means copy to 31 * @vm_write: 0 means copy from, 1 means copy to
@@ -147,6 +147,7 @@ static int process_vm_rw_single_vec(unsigned long addr,
147 * @riovcnt: size of rvec array 147 * @riovcnt: size of rvec array
148 * @flags: currently unused 148 * @flags: currently unused
149 * @vm_write: 0 if reading from other process, 1 if writing to other process 149 * @vm_write: 0 if reading from other process, 1 if writing to other process
150 *
150 * Returns the number of bytes read/written or error code. May 151 * Returns the number of bytes read/written or error code. May
151 * return less bytes than expected if an error occurs during the copying 152 * return less bytes than expected if an error occurs during the copying
152 * process. 153 * process.
@@ -197,11 +198,7 @@ static ssize_t process_vm_rw_core(pid_t pid, struct iov_iter *iter,
197 } 198 }
198 199
199 /* Get process information */ 200 /* Get process information */
200 rcu_read_lock(); 201 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) { 202 if (!task) {
206 rc = -ESRCH; 203 rc = -ESRCH;
207 goto free_proc_pages; 204 goto free_proc_pages;
@@ -253,6 +250,7 @@ free_proc_pages:
253 * @riovcnt: size of rvec array 250 * @riovcnt: size of rvec array
254 * @flags: currently unused 251 * @flags: currently unused
255 * @vm_write: 0 if reading from other process, 1 if writing to other process 252 * @vm_write: 0 if reading from other process, 1 if writing to other process
253 *
256 * Returns the number of bytes read/written or error code. May 254 * Returns the number of bytes read/written or error code. May
257 * return less bytes than expected if an error occurs during the copying 255 * return less bytes than expected if an error occurs during the copying
258 * process. 256 * process.