All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Viresh Kumar <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
	viresh.kumar@linaro.org, tglx@linutronix.de
Subject: [tip:timers/core] timer: Check failure of timer_cpu_notify() before calling init_timer_stats()
Date: Tue, 4 Mar 2014 03:33:30 -0800	[thread overview]
Message-ID: <tip-c24a4a369419c360c323865b91198878275c1481@git.kernel.org> (raw)
In-Reply-To: <c439f5b6bbc2047e1662f4d523350531425bcf9d.1393576981.git.viresh.kumar@linaro.org>

Commit-ID:  c24a4a369419c360c323865b91198878275c1481
Gitweb:     http://git.kernel.org/tip/c24a4a369419c360c323865b91198878275c1481
Author:     Viresh Kumar <viresh.kumar@linaro.org>
AuthorDate: Fri, 28 Feb 2014 14:15:21 +0530
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Tue, 4 Mar 2014 12:30:29 +0100

timer: Check failure of timer_cpu_notify() before calling init_timer_stats()

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>
Cc: linaro-kernel@lists.linaro.org
Cc: fweisbec@gmail.com
Cc: tj@kernel.org
Cc: peterz@infradead.org
Link: http://lkml.kernel.org/r/c439f5b6bbc2047e1662f4d523350531425bcf9d.1393576981.git.viresh.kumar@linaro.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/timer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/timer.c b/kernel/timer.c
index a71bdfd..31824ef 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -1681,9 +1681,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);
 }

      parent reply	other threads:[~2014-03-04 11:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-bot for Viresh Kumar [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-c24a4a369419c360c323865b91198878275c1481@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.