From patchwork Thu Jan 5 08:55:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Gautam X-Patchwork-Id: 9498709 X-Patchwork-Delegate: sboyd@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 090FE606B5 for ; Thu, 5 Jan 2017 08:57:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00DED27F85 for ; Thu, 5 Jan 2017 08:57:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E94D727FA3; Thu, 5 Jan 2017 08:57:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 985C227F85 for ; Thu, 5 Jan 2017 08:57:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936475AbdAEI5M (ORCPT ); Thu, 5 Jan 2017 03:57:12 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:59598 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935820AbdAEIzo (ORCPT ); Thu, 5 Jan 2017 03:55:44 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 97CCD60213; Thu, 5 Jan 2017 08:55:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1483606543; bh=/HMGWqLDLzPrh7wBZzDBJEZ9EP7yUO/N8bCKknp3Y8E=; h=From:To:Cc:Subject:Date:From; b=jbS2/co7mdd6QDHkJtl5M3Usr2xajMvn1OpcyWn4m3CEOJG2Qb8J7SKFsQ8UIL4xf dNWbGKOxCv4rXggIUI/SQ+NDWuivPscQSV9LrkJntP9/AcHH/53UkTKpLELESvI7xy Zsr432aTUahZVXzYyArBqNJc/nBZWv+P7nvjYwws= Received: from blr-ubuntu-41.ap.qualcomm.com (unknown [202.46.23.61]) (using TLSv1.1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: vivek.gautam@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 7B8DE60213; Thu, 5 Jan 2017 08:55:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1483606543; bh=/HMGWqLDLzPrh7wBZzDBJEZ9EP7yUO/N8bCKknp3Y8E=; h=From:To:Cc:Subject:Date:From; b=jbS2/co7mdd6QDHkJtl5M3Usr2xajMvn1OpcyWn4m3CEOJG2Qb8J7SKFsQ8UIL4xf dNWbGKOxCv4rXggIUI/SQ+NDWuivPscQSV9LrkJntP9/AcHH/53UkTKpLELESvI7xy Zsr432aTUahZVXzYyArBqNJc/nBZWv+P7nvjYwws= DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 7B8DE60213 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 To: sboyd@codeaurora.org, mturquette@baylibre.com Cc: andy.gross@linaro.org, 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, Vivek Gautam , Georgi Djakov Subject: [PATCH] clk: qcom: Fix a possible NULL pointer dereferencing Date: Thu, 5 Jan 2017 14:25:25 +0530 Message-Id: <1483606525-27709-1-git-send-email-vivek.gautam@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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; ret = devm_clk_hw_register(dev, &fixed->hw); if (ret)