public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: qcom: Fix a possible NULL pointer dereferencing
@ 2017-01-05  8:55 Vivek Gautam
  2017-01-05 14:20 ` Andy Gross
  0 siblings, 1 reply; 5+ messages in thread
From: Vivek Gautam @ 2017-01-05  8:55 UTC (permalink / raw)
  To: sboyd, mturquette
  Cc: andy.gross, david.brown, linux-arm-msm, linux-soc, linux-clk,
	linux-kernel, Vivek Gautam, Georgi Djakov

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;
 
 		ret = devm_clk_hw_register(dev, &fixed->hw);
 		if (ret)
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-01-06  5:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-05  8:55 [PATCH] clk: qcom: Fix a possible NULL pointer dereferencing Vivek Gautam
2017-01-05 14:20 ` Andy Gross
2017-01-05 18:18   ` Vivek Gautam
2017-01-05 22:39     ` Stephen Boyd
2017-01-06  4:58       ` Vivek Gautam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox