From: Mike Turquette <mturquette@linaro.org>
To: Stephen Boyd <sboyd@codeaurora.org>,
"Stanimir Varbanov" <svarbanov@mm-sol.com>
Cc: linux-kernel@vger.kernel.org,
"Tomeu Vizoso" <tomeu.vizoso@collabora.com>
Subject: Re: [PATCH] clk: fix possible null pointer dereference
Date: Sat, 17 Jan 2015 13:45:35 -0800 [thread overview]
Message-ID: <20150117214535.22722.64996@quantum> (raw)
In-Reply-To: <54AAE748.9010200@codeaurora.org>
Quoting Stephen Boyd (2015-01-05 11:34:32)
> 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>
Applied to clk-fixes.
Regards,
Mike
>
> > ---
> > 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
>
prev parent reply other threads:[~2015-01-17 21:45 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
2015-01-17 21:45 ` Mike Turquette [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=20150117214535.22722.64996@quantum \
--to=mturquette@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sboyd@codeaurora.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