@@ -886,15 +886,16 @@ static void __remove_hrtimer(struct hrtimer *timer,
struct hrtimer_clock_base *base,
unsigned long newstate, int reprogram)
{
+ struct timerqueue_node *next_timer;
if (!(timer->state & HRTIMER_STATE_ENQUEUED))
goto out;
+ next_timer = timerqueue_getnext(&base->active);
timerqueue_del(&base->active, &timer->node);
#ifdef CONFIG_HIGH_RES_TIMERS
/* Reprogram the clock event device. if enabled */
- if (reprogram && hrtimer_hres_active() &&
- &timer->node == timerqueue_getnext(&base->active)) {
+ if (reprogram && hrtimer_hres_active() && &timer->node == next_timer) {
ktime_t expires;
expires = ktime_sub(hrtimer_get_expires(timer), base->offset);