mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] timer: check failure of timer_cpu_notify() before calling init_timer_stats()
@ 2014-02-28  8:45 Viresh Kumar
  2014-02-28  8:45 ` [PATCH 2/2] timer: Make sure TIMER_FLAG_MASK bits are free in allocated base Viresh Kumar
  2014-03-04 11:33 ` [tip:timers/core] timer: Check failure of timer_cpu_notify() before calling init_timer_stats() tip-bot for Viresh Kumar
  0 siblings, 2 replies; 9+ messages in thread
From: Viresh Kumar @ 2014-02-28  8:45 UTC (permalink / raw)
  To: tglx
  Cc: linaro-kernel, linux-kernel, fweisbec, tj, peterz, mingo, Viresh Kumar

timer_cpu_notify() should return NOTIFY_OK and nothing else. Anything else would
trigger a BUG_ON(). Return value of this routine is already checked correctly
but is done after issuing a call to init_timer_stats(). The right order would be
to check the error case first and then call init_timer_stats(). Lets do it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 kernel/timer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/timer.c b/kernel/timer.c
index f64a98c..e8e7839 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -1674,9 +1674,9 @@ void __init init_timers(void)
 
 	err = timer_cpu_notify(&timers_nb, (unsigned long)CPU_UP_PREPARE,
 			       (void *)(long)smp_processor_id());
-	init_timer_stats();
-
 	BUG_ON(err != NOTIFY_OK);
+
+	init_timer_stats();
 	register_cpu_notifier(&timers_nb);
 	open_softirq(TIMER_SOFTIRQ, run_timer_softirq);
 }
-- 
1.7.12.rc2.18.g61b472e


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-03-19 20:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-28  8:45 [PATCH 1/2] timer: check failure of timer_cpu_notify() before calling init_timer_stats() Viresh Kumar
2014-02-28  8:45 ` [PATCH 2/2] timer: Make sure TIMER_FLAG_MASK bits are free in allocated base Viresh Kumar
2014-02-28 10:52   ` Thomas Gleixner
2014-02-28 16:51     ` Viresh Kumar
2014-03-11 10:26     ` Viresh Kumar
2014-03-18  8:09       ` Viresh Kumar
2014-03-19 20:32         ` Thomas Gleixner
2014-03-04 11:33   ` [tip:timers/core] " tip-bot for Viresh Kumar
2014-03-04 11:33 ` [tip:timers/core] timer: Check failure of timer_cpu_notify() before calling init_timer_stats() tip-bot for Viresh Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome