Skip to content

Commit

Permalink
hrtimer: fix hrtimer_init_sleeper() users
Browse files Browse the repository at this point in the history
this patch:

 commit 37bb6cb
 Author: Peter Zijlstra <a.p.zijlstra@chello.nl>
 Date:   Fri Jan 25 21:08:32 2008 +0100

     hrtimer: unlock hrtimer_wakeup

Broke hrtimer_init_sleeper() users. It forgot to fix up the futex
caller of this function to detect the failed queueing and messed up
the do_nanosleep() caller in that it could leak a TASK_INTERRUPTIBLE
state.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Feb 1, 2008
1 parent 24e1c13 commit 3588a08
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kernel/futex.c
Original file line number Diff line number Diff line change
Expand Up @@ -1252,6 +1252,8 @@ static int futex_wait(u32 __user *uaddr, struct rw_semaphore *fshared,
t.timer.expires = *abs_time;

hrtimer_start(&t.timer, t.timer.expires, HRTIMER_MODE_ABS);
if (!hrtimer_active(&t.timer))
t.task = NULL;

/*
* the timer could have already expired, in which
Expand Down
2 changes: 2 additions & 0 deletions kernel/hrtimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,8 @@ static int __sched do_nanosleep(struct hrtimer_sleeper *t, enum hrtimer_mode mod

} while (t->task && !signal_pending(current));

__set_current_state(TASK_RUNNING);

return t->task == NULL;
}

Expand Down

0 comments on commit 3588a08

Please sign in to comment.