From: Stephen Boyd <sboyd@codeaurora.org>
To: Stanimir Varbanov <svarbanov@mm-sol.com>,
Mike Turquette <mturquette@linaro.org>
Cc: linux-kernel@vger.kernel.org, Tomeu Vizoso <tomeu.vizoso@collabora.com>
Subject: Re: [PATCH] clk: fix possible null pointer dereference
Date: Mon, 05 Jan 2015 11:34:32 -0800 [thread overview]
Message-ID: <54AAE748.9010200@codeaurora.org> (raw)
In-Reply-To: <1420473863-30696-1-git-send-email-svarbanov@mm-sol.com>
On 01/05/2015 08:04 AM, Stanimir Varbanov wrote:
> The commit 646cafc6 (clk: Change clk_ops->determine_rate to
> return a clk_hw as the best parent) opens a possibility for
> null pointer dereference, fix this.
>
> Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>
Yep. Hopefully we can clean this all up soon.
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
> ---
> drivers/clk/clk.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index f4963b7..d48ac71 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -1366,7 +1366,7 @@ static struct clk *clk_calc_new_rates(struct clk *clk, unsigned long rate)
> new_rate = clk->ops->determine_rate(clk->hw, rate,
> &best_parent_rate,
> &parent_hw);
> - parent = parent_hw->clk;
> + parent = parent_hw ? parent_hw->clk : NULL;
> } else if (clk->ops->round_rate) {
> new_rate = clk->ops->round_rate(clk->hw, rate,
> &best_parent_rate);
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2015-01-05 19:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-05 16:04 [PATCH] clk: fix possible null pointer dereference Stanimir Varbanov
2015-01-05 19:34 ` Stephen Boyd [this message]
2015-01-17 21:45 ` Mike Turquette
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=54AAE748.9010200@codeaurora.org \
--to=sboyd@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@linaro.org \
--cc=svarbanov@mm-sol.com \
--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