diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2014-02-28 03:45:22 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2014-03-04 06:30:29 -0500 |
commit | 38edbb0b913d73713c23dcc742669f7e78b52aa7 (patch) | |
tree | f1a6fe60a4dd971adcda98a29595637225328470 | |
parent | c24a4a369419c360c323865b91198878275c1481 (diff) |
timer: Make sure TIMER_FLAG_MASK bits are free in allocated base
Currently we are using two lowest bit of base for internal purpose and
so they both should be zero in the allocated address. The code was
doing the right thing before this patch came in: commit c5f66e99b
(timer: Implement TIMER_IRQSAFE)
Tejun probably forgot to update this piece of code which checks if the
lowest 'n' bits are zero or not and so wasn't updated according to the
new flag. Lets use TIMER_FLAG_MASK in the calculations here.
[ tglx: Massaged changelog ]
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linaro-kernel@lists.linaro.org
Cc: fweisbec@gmail.com
Cc: tj@kernel.org
Cc: peterz@infradead.org
Link: http://lkml.kernel.org/r/9144e10d7e854a0aa8a673332adec356d81a923c.1393576981.git.viresh.kumar@linaro.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | kernel/timer.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/timer.c b/kernel/timer.c index 31824ef3eb96..949d74ea0ce4 100644 --- a/kernel/timer.c +++ b/kernel/timer.c | |||
@@ -1555,9 +1555,8 @@ static int init_timers_cpu(int cpu) | |||
1555 | if (!base) | 1555 | if (!base) |
1556 | return -ENOMEM; | 1556 | return -ENOMEM; |
1557 | 1557 | ||
1558 | /* Make sure that tvec_base is 2 byte aligned */ | 1558 | /* Make sure tvec_base has TIMER_FLAG_MASK bits free */ |
1559 | if (tbase_get_deferrable(base)) { | 1559 | if (WARN_ON(base != tbase_get_base(base))) { |
1560 | WARN_ON(1); | ||
1561 | kfree(base); | 1560 | kfree(base); |
1562 | return -ENOMEM; | 1561 | return -ENOMEM; |
1563 | } | 1562 | } |