From: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
To: Mike Turquette <mturquette@linaro.org>
Cc: "Stephen Boyd" <sboyd@codeaurora.org>,
"Tomeu Vizoso" <tomeu.vizoso@collabora.com>,
"Emilio López" <emilio@elopez.com.ar>,
linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org,
"Javier Martinez Canillas" <javier.martinez@collabora.co.uk>
Subject: [PATCH 1/2] clk: Don't dereference parent clock if is NULL
Date: Wed, 11 Feb 2015 11:13:30 +0100 [thread overview]
Message-ID: <1423649612-31746-2-git-send-email-javier.martinez@collabora.co.uk> (raw)
In-Reply-To: <1423649612-31746-1-git-send-email-javier.martinez@collabora.co.uk>
The clock passed as an argument to clk_mux_determine_rate_flags() can
not have a parent clock if is either a root clock or an orphan.
In those cases parent is NULL so parent->hw shouldn't be dereferenced.
Fixes: 035a61c314eb3 ("clk: Make clk API return per-user struct clk instances")
Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
---
drivers/clk/clk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 7f53166af5e6..7bd8893c94d6 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -799,7 +799,7 @@ clk_mux_determine_rate_flags(struct clk_hw *hw, unsigned long rate,
/* if NO_REPARENT flag set, pass through to current parent */
if (core->flags & CLK_SET_RATE_NO_REPARENT) {
parent = core->parent;
- if (core->flags & CLK_SET_RATE_PARENT)
+ if (core->flags & CLK_SET_RATE_PARENT && parent)
best = __clk_determine_rate(parent->hw, rate,
min_rate, max_rate);
else if (parent)
--
2.1.3
next prev parent reply other threads:[~2015-02-11 10:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-11 10:13 [PATCH 0/2] clk: Some fixes for the per-user clk API changes Javier Martinez Canillas
2015-02-11 10:13 ` Javier Martinez Canillas [this message]
2015-02-11 18:54 ` [PATCH 1/2] clk: Don't dereference parent clock if is NULL Stephen Boyd
2015-02-12 13:35 ` Javier Martinez Canillas
2015-02-11 10:13 ` [PATCH 2/2] clk: composite: Set clk_core to composite rate and mux components Javier Martinez Canillas
2015-02-11 18:50 ` Stephen Boyd
2015-02-12 13:27 ` Javier Martinez Canillas
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=1423649612-31746-2-git-send-email-javier.martinez@collabora.co.uk \
--to=javier.martinez@collabora.co.uk \
--cc=emilio@elopez.com.ar \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=mturquette@linaro.org \
--cc=sboyd@codeaurora.org \
--cc=tomeu.vizoso@collabora.com \
/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
all inboxes | Powered by JetHome®