Linux clock framework development
 help / color / mirror / Atom feed
From: Andy Gross <andy.gross@linaro.org>
To: Vivek Gautam <vivek.gautam@codeaurora.org>
Cc: sboyd@codeaurora.org, mturquette@baylibre.com,
	david.brown@linaro.org, linux-arm-msm@vger.kernel.org,
	linux-soc@vger.kernel.org, linux-clk@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Georgi Djakov <georgi.djakov@linaro.org>
Subject: Re: [PATCH] clk: qcom: Fix a possible NULL pointer dereferencing
Date: Thu, 5 Jan 2017 08:20:02 -0600	[thread overview]
Message-ID: <20170105142002.GB5710@hector.attlocal.net> (raw)
In-Reply-To: <1483606525-27709-1-git-send-email-vivek.gautam@codeaurora.org>

On Thu, Jan 05, 2017 at 02:25:25PM +0530, Vivek Gautam wrote:
> Assign num_parents as 0 while registering fixed rate clocks
> in _qcom_cc_register_board_clk(), to make sure the clk framework
> doesn't dereference parent.
> 
> Fixes: ee15faffef11 ("clk: qcom: common: Add API to register board clocks backwards compatibly")
> 
> Cc: Georgi Djakov <georgi.djakov@linaro.org>
> Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
> ---
> 
> Based on 'clk-next'. Build tested.
> 
>  drivers/clk/qcom/common.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/clk/qcom/common.c b/drivers/clk/qcom/common.c
> index cfab7b400381..df004ead1bef 100644
> --- a/drivers/clk/qcom/common.c
> +++ b/drivers/clk/qcom/common.c
> @@ -157,6 +157,7 @@ static int _qcom_cc_register_board_clk(struct device *dev, const char *path,
>  
>  		init_data.name = path;
>  		init_data.ops = &clk_fixed_rate_ops;
> +		init_data.num_parents = 0;

It seems like there was a initializer in the declaration but it was { } instead
of { 0 }.

Was the original intent to make this structure initialized to 0?  If so, perhaps
it should be fixed above in the initializer.

>  
>  		ret = devm_clk_hw_register(dev, &fixed->hw);
>  		if (ret)


Regards,

Andy

  reply	other threads:[~2017-01-05 14:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-05  8:55 [PATCH] clk: qcom: Fix a possible NULL pointer dereferencing Vivek Gautam
2017-01-05 14:20 ` Andy Gross [this message]
2017-01-05 18:18   ` Vivek Gautam
2017-01-05 22:39     ` Stephen Boyd
2017-01-06  4:58       ` Vivek Gautam

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=20170105142002.GB5710@hector.attlocal.net \
    --to=andy.gross@linaro.org \
    --cc=david.brown@linaro.org \
    --cc=georgi.djakov@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-soc@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@codeaurora.org \
    --cc=vivek.gautam@codeaurora.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