diff options
| author | 2008-12-08 15:07:49 +0100 | |
|---|---|---|
| committer | 2008-12-08 15:07:49 +0100 | |
| commit | aa9c9b8c584a42a094202b7e0f63497e888f86a7 (patch) | |
| tree | 3cb3b022054a7c1722657288518f495e0c4d9983 /kernel/posix-cpu-timers.c | |
| parent | x86: fix wakeup_cpu with numaq/es7000 v2 - call ->update_genapic() (diff) | |
| parent | Fix a race condition in FASYNC handling (diff) | |
| download | linux-dev-aa9c9b8c584a42a094202b7e0f63497e888f86a7.tar.xz linux-dev-aa9c9b8c584a42a094202b7e0f63497e888f86a7.zip | |
Merge branch 'linus' into x86/quirks
Diffstat (limited to 'kernel/posix-cpu-timers.c')
| -rw-r--r-- | kernel/posix-cpu-timers.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c index 153dcb2639c3..4e5288a831de 100644 --- a/kernel/posix-cpu-timers.c +++ b/kernel/posix-cpu-timers.c @@ -311,7 +311,7 @@ static int cpu_clock_sample_group(const clockid_t which_clock, struct task_cputime cputime; thread_group_cputime(p, &cputime); - switch (which_clock) { + switch (CPUCLOCK_WHICH(which_clock)) { default: return -EINVAL; case CPUCLOCK_PROF: @@ -1308,9 +1308,10 @@ static inline int task_cputime_expired(const struct task_cputime *sample, */ static inline int fastpath_timer_check(struct task_struct *tsk) { - struct signal_struct *sig = tsk->signal; + struct signal_struct *sig; - if (unlikely(!sig)) + /* tsk == current, ensure it is safe to use ->signal/sighand */ + if (unlikely(tsk->exit_state)) return 0; if (!task_cputime_zero(&tsk->cputime_expires)) { @@ -1323,6 +1324,8 @@ static inline int fastpath_timer_check(struct task_struct *tsk) if (task_cputime_expired(&task_sample, &tsk->cputime_expires)) return 1; } + + sig = tsk->signal; if (!task_cputime_zero(&sig->cputime_expires)) { struct task_cputime group_sample; |
