From patchwork Mon May 18 14:00:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricky Liang X-Patchwork-Id: 6429671 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5271EC0432 for ; Mon, 18 May 2015 14:04:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7FD85205BE for ; Mon, 18 May 2015 14:04:10 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9BAB3205B9 for ; Mon, 18 May 2015 14:04:09 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YuLbz-0002Xo-Jl; Mon, 18 May 2015 14:01:43 +0000 Received: from mail-pa0-x229.google.com ([2607:f8b0:400e:c03::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YuLbn-0002MT-R9 for linux-arm-kernel@lists.infradead.org; Mon, 18 May 2015 14:01:33 +0000 Received: by pacwv17 with SMTP id wv17so153614084pac.2 for ; Mon, 18 May 2015 07:01:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=Ooc0Z77TOuT3nM6rzyOjP9PNXJqagDR9yVDBHAV8avo=; b=ZPoaXhyPzgT/rxgzKSMB10Jkw/gRktkCpXJey2C7XPPVPF71UL/JWwg14jUASjS8XJ TdkXbUiW5xaajG5bX4F4xcOjvsYi67yhU2xQL5SQvR7+fEEi7nzBc2Ub9osYIqCvKss3 gkWll+XY1zma00QAunlkXk0wG1gwn4RPnI9TE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Ooc0Z77TOuT3nM6rzyOjP9PNXJqagDR9yVDBHAV8avo=; b=aeuTLybZQMx0hvIs+L09+VmbBHwly2iVvSig1Ym3vaJDIwEYRcip9tod2J3+G/wj7i YHZx1Jw0kwA60SbM7nhg2aw0nLj0Qv9XDI1T5gsUBigfpfYu8AsqkxpA+LsA/Arg78AR mQCtRQdUUKYQELhQoNp5q7J68KBPtDVWPTTL2BwkXuyRsmjpY2Iu2tkV6xfIQg5ya4Yk NCdN+Ap3oEcbC6SBrGD5z+prZLuVopbJ/ezunai9cfwL/RdsJrMORt3yGeaFRF1XMTDM xttLL4ODEq/J9cX6tOO267v+qfwmrjCH+brZdM15V4zNKmgfG3FmTDKqXrgKXYc8sZcn VxWw== X-Gm-Message-State: ALoCoQkNqLkItv5+h8DCA3nW7nQoQ3SkkkprABcyYePVaLoTY/XJzLuvGFffGppT4vYm1Xfy846h X-Received: by 10.68.93.68 with SMTP id cs4mr44574773pbb.139.1431957670258; Mon, 18 May 2015 07:01:10 -0700 (PDT) Received: from jcliang-z620.tpe.corp.google.com ([172.30.210.189]) by mx.google.com with ESMTPSA id sc1sm10267232pac.36.2015.05.18.07.01.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 May 2015 07:01:09 -0700 (PDT) From: Ricky Liang To: Mike Turquette , Stephen Boyd Subject: [PATCH v3] clk: mediatek: Initialize clk_init_data Date: Mon, 18 May 2015 22:00:26 +0800 Message-Id: <1431957632-2182-1-git-send-email-jcliang@chromium.org> X-Mailer: git-send-email 2.1.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150518_070131_994256_9606EBC6 X-CRM114-Status: GOOD ( 11.04 ) X-Spam-Score: -0.8 (/) Cc: James Liao , Sascha Hauer , open list , Henry Chen , Ricky Liang , "moderated list:ARM/Mediatek SoC..." , Matthias Brugger , "open list:COMMON CLK FRAMEWORK" , "moderated list:ARM/Mediatek SoC..." X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The variable init (struct clk_init_data) is allocated on the stack. We weren't initializing the .flags field, so it contains random junk, which can cause all kinds of interesting issues when the flags are parsed by clk_register. Signed-off-by: Ricky Liang Acked-by: Sascha Hauer --- drivers/clk/mediatek/clk-gate.c | 2 +- drivers/clk/mediatek/clk-pll.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/mediatek/clk-gate.c b/drivers/clk/mediatek/clk-gate.c index 9d77ee3..5702036 100644 --- a/drivers/clk/mediatek/clk-gate.c +++ b/drivers/clk/mediatek/clk-gate.c @@ -109,7 +109,7 @@ struct clk *mtk_clk_register_gate( { struct mtk_clk_gate *cg; struct clk *clk; - struct clk_init_data init; + struct clk_init_data init = {}; cg = kzalloc(sizeof(*cg), GFP_KERNEL); if (!cg) diff --git a/drivers/clk/mediatek/clk-pll.c b/drivers/clk/mediatek/clk-pll.c index 66154ca..44409e9 100644 --- a/drivers/clk/mediatek/clk-pll.c +++ b/drivers/clk/mediatek/clk-pll.c @@ -268,7 +268,7 @@ static struct clk *mtk_clk_register_pll(const struct mtk_pll_data *data, void __iomem *base) { struct mtk_clk_pll *pll; - struct clk_init_data init; + struct clk_init_data init = {}; struct clk *clk; const char *parent_name = "clk26m";