| Message ID | 7c480e73222bb51982fb82dc0cc6cd503f2e8b92.1787239813.git.geert+renesas@glider.be (mailing list archive) |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-sunxi+bounces-25284-sunxi=pue.re@lists.linux.dev> X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id AF9731C0768 for <noreply@patchwork.local>; Fri, 21 Aug 2026 11:21:52 +0200 (CEST) Authentication-Results: mxe881; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-25284-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-25284-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id CBC1930FAF5F for <noreply@patchwork.local>; Fri, 21 Aug 2026 09:06:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BB2E547013C; Fri, 21 Aug 2026 09:04:46 +0000 (UTC) X-Original-To: linux-sunxi@lists.linux.dev Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C150546C82A; Fri, 21 Aug 2026 09:04:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787303085; cv=none; b=ckFHKdywq8VJciSk24U2DxWdXm0nPqP2AJk3+ttbkuwCMR2UfUJd/RDiCXgasZO/Jnes43ck1+5Gq5taCRZ7oyx+eRXZV7aR4GiRSihzaOLglbbbOgmpW3MMQTyX4ANRMJynD2bKpy9/FMYnCu86jJcftsQfZWOg/1Nbgx9751c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787303085; c=relaxed/simple; bh=bz0Q5cxU+XpN4bR/II11/oeb7Q0jJpY2bGDeu5jnV6Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AQEMOVNMoP99OQF4Ft5j77Ml8PBhtHuSI7RefSotAXLnL30LeRt4Wb5kcsvdipuVScPDN+0YhXspZmK1KPcUr9Z1DUBW7xj8sY0OqcnDfO6mhVdwuL9yc9pMzmci5D6F7IlPPv8AOP6BQeNHyUYaRAwIgAKH3LNpS8EodDYF9yQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 Received: by smtp.kernel.org (Postfix) with ESMTPSA id EBE701F000E9; Fri, 21 Aug 2026 09:04:14 +0000 (UTC) From: Geert Uytterhoeven <geert+renesas@glider.be> To: Ryan Chen <ryan_chen@aspeedtech.com>, Joel Stanley <joel@jms.id.au>, Stephen Boyd <sboyd@kernel.org>, Brian Masney <bmasney+clk@redhat.com>, Jerome Brunet <jbrunet+clk@baylibre.com>, Andrew Jeffery <andrew@codeconstruct.com.au>, Billy Tsai <billy_tsai@aspeedtech.com>, Nicolas Ferre <nicolas.ferre@microchip.com>, Alexandre Belloni <alexandre.belloni@bootlin.com>, Claudiu Beznea <claudiu.beznea@tuxon.dev>, Ray Jui <rjui@broadcom.com>, Scott Branden <sbranden@broadcom.com>, Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, Taichi Sugaya <sugaya.taichi@socionext.com>, Takao Orito <orito.takao@socionext.com>, Linus Walleij <linusw@kernel.org>, Avi Fishman <avifishman70@gmail.com>, Tomer Maimon <tmaimon77@gmail.com>, Tali Perry <tali.perry1@gmail.com>, Patrick Venture <venture@google.com>, Nancy Yuen <yuenn@google.com>, Benjamin Fair <benjaminfair@google.com>, Sudeep Holla <sudeep.holla@kernel.org>, Cristian Marussi <cristian.marussi@arm.com>, David Lechner <david@lechnology.com>, Abel Vesa <abelvesa@kernel.org>, Peng Fan <peng.fan@nxp.com>, Frank Li <Frank.Li@nxp.com>, Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix Kernel Team <kernel@pengutronix.de>, Fabio Estevam <festevam@gmail.com>, Paul Cercueil <paul@crapouillou.net>, Santosh Shilimkar <ssantosh@kernel.org>, Andrew Lunn <andrew@lunn.ch>, Gregory Clement <gregory.clement@bootlin.com>, Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>, Vladimir Zapolskiy <vz@mleia.com>, Heiko Stuebner <heiko@sntech.de>, Krzysztof Kozlowski <krzk@kernel.org>, Sylwester Nawrocki <s.nawrocki@samsung.com>, Chanwoo Choi <cw00.choi@samsung.com>, Peter Griffin <peter.griffin@linaro.org>, Alim Akhtar <alim.akhtar@samsung.com>, Dinh Nguyen <dinguyen@kernel.org>, Viresh Kumar <vireshk@kernel.org>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, Alexandre Torgue <alexandre.torgue@foss.st.com>, =?utf-8?q?Emilio_L=C3=B3pe?= =?utf-8?q?z?= <emilio@elopez.com.ar>, Chen-Yu Tsai <wens@kernel.org>, Jernej Skrabec <jernej.skrabec@gmail.com>, Samuel Holland <samuel@sholland.org>, Prashant Gaikwad <pgaikwad@nvidia.com>, Thierry Reding <thierry.reding@kernel.org>, Jonathan Hunter <jonathanh@nvidia.com>, Kunihiko Hayashi <hayashi.kunihiko@socionext.com>, Masami Hiramatsu <mhiramat@kernel.org>, Ulf Hansson <ulfh@kernel.org>, Liviu Dudau <liviu.dudau@arm.com>, Lorenzo Pieralisi <lpieralisi@kernel.org>, Michal Simek <michal.simek@amd.com>, Matthias Brugger <matthias.bgg@gmail.com> Cc: linux-clk@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, arm-scmi@vger.kernel.org, imx@lists.linux.dev, linux-mips@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-samsung-soc@vger.kernel.org, soc@lists.linux.dev, linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org, Geert Uytterhoeven <geert+renesas@glider.be> Subject: [PATCH 40/45] clk: versatile: Make sure clk_init_data is fully initialized Date: Fri, 21 Aug 2026 10:53:50 +0200 Message-ID: <7c480e73222bb51982fb82dc0cc6cd503f2e8b92.1787239813.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.43.0 In-Reply-To: <cover.1787239813.git.geert+renesas@glider.be> References: <cover.1787239813.git.geert+renesas@glider.be> Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: <linux-sunxi.lists.linux.dev> List-Subscribe: <mailto:linux-sunxi+subscribe@lists.linux.dev> List-Unsubscribe: <mailto:linux-sunxi+unsubscribe@lists.linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= |
| Series |
clk: Make sure clk_init_data is fully initialized (part two)
|
|
Commit Message
Geert Uytterhoeven
Aug. 21, 2026, 8:53 a.m. UTC
The clk_init_data structure contains several mutually-exclusive members
for different methods to specify the possible parents of a clock,
prompting drivers to initialize only the members they need. However,
not initializing all members may cause subtle issues, which are only
exposed when CONFIG_INIT_STACK_ALL_PATTERN or CONFIG_INIT_STACK_NONE is
enabled.
Make sure all members are fully initialized, to avoid such bugs, and to
prevent future breakage when converting drivers to a different method
for specifying the parents.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Compile-tested only.
---
drivers/clk/versatile/clk-icst.c | 2 +-
drivers/clk/versatile/clk-sp810.c | 2 +-
drivers/clk/versatile/clk-vexpress-osc.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
Comments
On Fri, Aug 21, 2026 at 10:53:50AM +0200, Geert Uytterhoeven wrote: > The clk_init_data structure contains several mutually-exclusive members > for different methods to specify the possible parents of a clock, > prompting drivers to initialize only the members they need. However, > not initializing all members may cause subtle issues, which are only > exposed when CONFIG_INIT_STACK_ALL_PATTERN or CONFIG_INIT_STACK_NONE is > enabled. > > Make sure all members are fully initialized, to avoid such bugs, and to > prevent future breakage when converting drivers to a different method > for specifying the parents. > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Best regards, Liviu > --- > Compile-tested only. > --- > drivers/clk/versatile/clk-icst.c | 2 +- > drivers/clk/versatile/clk-sp810.c | 2 +- > drivers/clk/versatile/clk-vexpress-osc.c | 2 +- > 3 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/clk/versatile/clk-icst.c b/drivers/clk/versatile/clk-icst.c > index 6bd3db54dd229d28..97a1bfd6cf0ed995 100644 > --- a/drivers/clk/versatile/clk-icst.c > +++ b/drivers/clk/versatile/clk-icst.c > @@ -360,8 +360,8 @@ struct clk *icst_clk_setup(struct device *dev, > { > struct clk *clk; > struct clk_icst *icst; > - struct clk_init_data init; > struct icst_params *pclone; > + struct clk_init_data init = {}; > > icst = kzalloc_obj(*icst); > if (!icst) > diff --git a/drivers/clk/versatile/clk-sp810.c b/drivers/clk/versatile/clk-sp810.c > index b0e69686f7a9a93e..28e5c0cf1fda38e4 100644 > --- a/drivers/clk/versatile/clk-sp810.c > +++ b/drivers/clk/versatile/clk-sp810.c > @@ -86,7 +86,7 @@ static void __init clk_sp810_of_setup(struct device_node *node) > const char *parent_names[2]; > int num = ARRAY_SIZE(parent_names); > char name[12]; > - struct clk_init_data init; > + struct clk_init_data init = {}; > static int instance; > int i; > bool deprecated; > diff --git a/drivers/clk/versatile/clk-vexpress-osc.c b/drivers/clk/versatile/clk-vexpress-osc.c > index 9adbf5c33bd1cada..72e872ec6b7c9b47 100644 > --- a/drivers/clk/versatile/clk-vexpress-osc.c > +++ b/drivers/clk/versatile/clk-vexpress-osc.c > @@ -64,7 +64,7 @@ static const struct clk_ops vexpress_osc_ops = { > > static int vexpress_osc_probe(struct platform_device *pdev) > { > - struct clk_init_data init; > + struct clk_init_data init = {}; > struct vexpress_osc *osc; > u32 range[2]; > int ret; > -- > 2.43.0 >
diff --git a/drivers/clk/versatile/clk-icst.c b/drivers/clk/versatile/clk-icst.c index 6bd3db54dd229d28..97a1bfd6cf0ed995 100644 --- a/drivers/clk/versatile/clk-icst.c +++ b/drivers/clk/versatile/clk-icst.c @@ -360,8 +360,8 @@ struct clk *icst_clk_setup(struct device *dev, { struct clk *clk; struct clk_icst *icst; - struct clk_init_data init; struct icst_params *pclone; + struct clk_init_data init = {}; icst = kzalloc_obj(*icst); if (!icst) diff --git a/drivers/clk/versatile/clk-sp810.c b/drivers/clk/versatile/clk-sp810.c index b0e69686f7a9a93e..28e5c0cf1fda38e4 100644 --- a/drivers/clk/versatile/clk-sp810.c +++ b/drivers/clk/versatile/clk-sp810.c @@ -86,7 +86,7 @@ static void __init clk_sp810_of_setup(struct device_node *node) const char *parent_names[2]; int num = ARRAY_SIZE(parent_names); char name[12]; - struct clk_init_data init; + struct clk_init_data init = {}; static int instance; int i; bool deprecated; diff --git a/drivers/clk/versatile/clk-vexpress-osc.c b/drivers/clk/versatile/clk-vexpress-osc.c index 9adbf5c33bd1cada..72e872ec6b7c9b47 100644 --- a/drivers/clk/versatile/clk-vexpress-osc.c +++ b/drivers/clk/versatile/clk-vexpress-osc.c @@ -64,7 +64,7 @@ static const struct clk_ops vexpress_osc_ops = { static int vexpress_osc_probe(struct platform_device *pdev) { - struct clk_init_data init; + struct clk_init_data init = {}; struct vexpress_osc *osc; u32 range[2]; int ret;