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: 6429661 Return-Path: X-Original-To: patchwork-linux-mediatek@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 5A07EC0432 for ; Mon, 18 May 2015 14:01:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7B8BA205EE for ; Mon, 18 May 2015 14:01:58 +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 0B0F8204C9 for ; Mon, 18 May 2015 14:01:53 +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 1YuLc8-0002fH-Kl; Mon, 18 May 2015 14:01:52 +0000 Received: from mail-pd0-x236.google.com ([2607:f8b0:400e:c02::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YuLbo-0002MU-3J for linux-mediatek@lists.infradead.org; Mon, 18 May 2015 14:01:37 +0000 Received: by pdbnk13 with SMTP id nk13so55554434pdb.1 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=SjAjgidEPoENCZt4/MJ7Ns1gLS0jzYVFsT3Ay36RQShstl52NPiPkmUKbEJBxoWWYM n9LW462IZFc2egdnhAbSImo3r+fCLwC00uO5CD245Dju9R5D67RL9bGBRysTNuH0R2N9 cMbANtLe24UKefB3HrEfSPmaZMaDSK8gEavh3ZRS8t/sNGRwJSAoiYeCPDdkPsGlotTb JEEBptmViBx2Z1tN+01xpgxE/Hf01jNnMRRgwZSCmSUIIbXdx/6x1XQdlAuPLgVwVhhW scDWJhF3ioYD6IvfGqaRc3vI6n+iFRjj40Or9vfMUaSGNk3aL5bqffJbOfH/t7jSHzNh TCoQ== X-Gm-Message-State: ALoCoQk98WKl2c9PH2qbQEdGeix2EYBRiRvo0lC//GOPR27jTIKWF7JWihRIggGmOnmTRBFWAnAj 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_070132_230964_7FC8D99D X-CRM114-Status: UNSURE ( 9.27 ) X-CRM114-Notice: Please train this message. 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-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=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=ham 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";