diff options
-rw-r--r-- | litmus/litmus.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/litmus/litmus.c b/litmus/litmus.c index db5ce0e9c76e..885d75493118 100644 --- a/litmus/litmus.c +++ b/litmus/litmus.c | |||
@@ -184,21 +184,24 @@ asmlinkage long sys_get_rt_task_param(pid_t pid, struct rt_task __user * param) | |||
184 | int retval = -EINVAL; | 184 | int retval = -EINVAL; |
185 | struct task_struct *source; | 185 | struct task_struct *source; |
186 | struct rt_task lp; | 186 | struct rt_task lp; |
187 | |||
187 | if (param == 0 || pid < 0) | 188 | if (param == 0 || pid < 0) |
188 | goto out; | 189 | goto out; |
189 | read_lock(&tasklist_lock); | 190 | |
190 | if (!(source = find_task_by_vpid(pid))) { | 191 | read_lock_irq(&tasklist_lock); |
192 | rcu_read_lock(); | ||
193 | source = find_task_by_vpid(pid); | ||
194 | rcu_read_unlock(); | ||
195 | if (!source) { | ||
191 | retval = -ESRCH; | 196 | retval = -ESRCH; |
192 | goto out_unlock; | 197 | read_unlock_irq(&tasklist_lock); |
198 | goto out; | ||
193 | } | 199 | } |
194 | lp = source->rt_param.task_params; | 200 | lp = source->rt_param.task_params; |
195 | read_unlock(&tasklist_lock); | 201 | read_unlock_irq(&tasklist_lock); |
196 | /* Do copying outside the lock */ | 202 | /* Do copying outside the lock */ |
197 | retval = | 203 | retval = |
198 | copy_to_user(param, &lp, sizeof(lp)) ? -EFAULT : 0; | 204 | copy_to_user(param, &lp, sizeof(lp)) ? -EFAULT : 0; |
199 | return retval; | ||
200 | out_unlock: | ||
201 | read_unlock(&tasklist_lock); | ||
202 | out: | 205 | out: |
203 | return retval; | 206 | return retval; |
204 | 207 | ||