public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: t-kristo@ti.com (Tero Kristo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm: smp-twd: check for uninitialized clock in twd_cpufreq_init
Date: Fri, 17 Feb 2012 12:34:29 +0200	[thread overview]
Message-ID: <1329474869-32356-1-git-send-email-t-kristo@ti.com> (raw)

Non-smp platforms don't have local timer support, but the twd_cpufreq_init
only checks for IS_ERR during init. Check against null also, to avoid
crashes during cpufreq transitions on non-smp platforms.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 arch/arm/kernel/smp_twd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index 4285daa..dae8902 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -129,7 +129,7 @@ static struct notifier_block twd_cpufreq_nb = {
 
 static int twd_cpufreq_init(void)
 {
-	if (!IS_ERR(twd_clk))
+	if (twd_clk && !IS_ERR(twd_clk))
 		return cpufreq_register_notifier(&twd_cpufreq_nb,
 			CPUFREQ_TRANSITION_NOTIFIER);
 
-- 
1.7.4.1

             reply	other threads:[~2012-02-17 10:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-17 10:34 Tero Kristo [this message]
2012-02-17 10:47 ` [PATCH] arm: smp-twd: check for uninitialized clock in twd_cpufreq_init Shilimkar, Santosh
2012-02-17 11:09   ` Tero Kristo
2012-02-18 15:56 ` Sergei Shtylyov

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=1329474869-32356-1-git-send-email-t-kristo@ti.com \
    --to=t-kristo@ti.com \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox