From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763212AbdAESTO (ORCPT ); Thu, 5 Jan 2017 13:19:14 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:59148 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753076AbdAESSJ (ORCPT ); Thu, 5 Jan 2017 13:18:09 -0500 DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 82BF9603D2 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=vivek.gautam@codeaurora.org From: Vivek Gautam Subject: Re: [PATCH] clk: qcom: Fix a possible NULL pointer dereferencing To: Andy Gross References: <1483606525-27709-1-git-send-email-vivek.gautam@codeaurora.org> <20170105142002.GB5710@hector.attlocal.net> 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 Message-ID: <9b590296-6e3a-9079-08e5-48b4af8f8f22@codeaurora.org> Date: Thu, 5 Jan 2017 23:48:00 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20170105142002.GB5710@hector.attlocal.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/05/2017 07:50 PM, Andy Gross wrote: > 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 >> Signed-off-by: Vivek Gautam >> --- >> >> 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. yes, i think we intend to initialize the clock init data to 0, and thus we should do that during declaration. Will modify and re-spin the patch. Regards Vivek >> >> ret = devm_clk_hw_register(dev, &fixed->hw); >> if (ret) > Regards, > > Andy > -- > To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in > the body of a message tomajordomo@vger.kernel.org > More majordomo info athttp://vger.kernel.org/majordomo-info.html -- The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project