Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 200654
b: refs/heads/master
c: 7a0ea09
h: refs/heads/master
v: v3
  • Loading branch information
Michal Hocko authored and Linus Torvalds committed Jun 30, 2010
1 parent 3d6bb42 commit ad53953
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f4985dc714d7ab1920c5aa502b7f4073fa1b4177
refs/heads/master: 7a0ea09ad5352efce8fe79ed853150449903b9f5
17 changes: 4 additions & 13 deletions trunk/kernel/futex.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,20 +429,11 @@ static void free_pi_state(struct futex_pi_state *pi_state)
static struct task_struct * futex_find_get_task(pid_t pid)
{
struct task_struct *p;
const struct cred *cred = current_cred(), *pcred;

rcu_read_lock();
p = find_task_by_vpid(pid);
if (!p) {
p = ERR_PTR(-ESRCH);
} else {
pcred = __task_cred(p);
if (cred->euid != pcred->euid &&
cred->euid != pcred->uid)
p = ERR_PTR(-ESRCH);
else
get_task_struct(p);
}
if (p)
get_task_struct(p);

rcu_read_unlock();

Expand Down Expand Up @@ -564,8 +555,8 @@ lookup_pi_state(u32 uval, struct futex_hash_bucket *hb,
if (!pid)
return -ESRCH;
p = futex_find_get_task(pid);
if (IS_ERR(p))
return PTR_ERR(p);
if (!p)
return -ESRCH;

/*
* We need to look at the task state flags to figure out,
Expand Down

0 comments on commit ad53953

Please sign in to comment.