idr_remove(&posix_timers_id, tmr->it_id);
spin_unlock_irqrestore(&idr_lock, flags);
}
+ put_pid(tmr->it_pid);
sigqueue_free(tmr->sigq);
kmem_cache_free(posix_timers_cache, tmr);
}
{
struct k_itimer *new_timer;
int error, new_timer_id;
- struct pid *it_pid;
sigevent_t event;
int it_id_set = IT_ID_NOT_SET;
goto out;
}
rcu_read_lock();
- it_pid = get_pid(good_sigevent(&event));
+ new_timer->it_pid = get_pid(good_sigevent(&event));
rcu_read_unlock();
- if (!it_pid) {
+ if (!new_timer->it_pid) {
error = -EINVAL;
goto out;
}
event.sigev_notify = SIGEV_SIGNAL;
event.sigev_signo = SIGALRM;
event.sigev_value.sival_int = new_timer->it_id;
- it_pid = get_pid(task_tgid(current));
+ new_timer->it_pid = get_pid(task_tgid(current));
}
new_timer->it_sigev_notify = event.sigev_notify;
new_timer->sigq->info.si_code = SI_TIMER;
spin_lock_irq(¤t->sighand->siglock);
- new_timer->it_pid = it_pid;
new_timer->it_signal = current->signal;
list_add(&new_timer->list, ¤t->signal->posix_timers);
spin_unlock_irq(¤t->sighand->siglock);
timr = idr_find(&posix_timers_id, (int)timer_id);
if (timr) {
spin_lock(&timr->it_lock);
- if (timr->it_pid && timr->it_signal == current->signal) {
+ if (timr->it_signal == current->signal) {
spin_unlock(&idr_lock);
return timr;
}
* This keeps any tasks waiting on the spin lock from thinking
* they got something (see the lock code above).
*/
- put_pid(timer->it_pid);
- timer->it_pid = NULL;
+ timer->it_signal = NULL;
unlock_timer(timer, flags);
release_posix_timer(timer, IT_ID_SET);
* This keeps any tasks waiting on the spin lock from thinking
* they got something (see the lock code above).
*/
- put_pid(timer->it_pid);
- timer->it_pid = NULL;
+ timer->it_signal = NULL;
unlock_timer(timer, flags);
release_posix_timer(timer, IT_ID_SET);