From patchwork Wed Oct 28 15:03:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 7512961 Return-Path: X-Original-To: patchwork-alsa-devel@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 34CD7BEEA4 for ; Wed, 28 Oct 2015 15:04:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9441B20864 for ; Wed, 28 Oct 2015 15:04:07 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 3D48520858 for ; Wed, 28 Oct 2015 15:04:05 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id A1AA92625CF; Wed, 28 Oct 2015 16:04:03 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 60243261AB0; Wed, 28 Oct 2015 16:03:55 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 9C244261AB7; Wed, 28 Oct 2015 16:03:54 +0100 (CET) Received: from michel.telenet-ops.be (michel.telenet-ops.be [195.130.137.88]) by alsa0.perex.cz (Postfix) with ESMTP id 8474F261A80 for ; Wed, 28 Oct 2015 16:03:47 +0100 (CET) Received: from ayla.of.borg ([84.195.106.123]) by michel.telenet-ops.be with bizsmtp id af3m1r0082fm56U06f3mHd; Wed, 28 Oct 2015 16:03:47 +0100 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.82) (envelope-from ) id 1ZrSGP-00074T-VX; Wed, 28 Oct 2015 16:03:46 +0100 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1ZrSGV-0004PZ-VG; Wed, 28 Oct 2015 16:03:51 +0100 From: Geert Uytterhoeven To: Liam Girdwood , Mark Brown , Kuninori Morimoto Date: Wed, 28 Oct 2015 16:03:48 +0100 Message-Id: <1446044628-16924-1-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 1.9.1 Cc: alsa-devel@alsa-project.org, Geert Uytterhoeven , linux-sh@vger.kernel.org Subject: [alsa-devel] [PATCH] [RFC] ASoC: rsnd: Add missing initialization of ADG req_rate X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP If the "clock-frequency" DT property is not found, req_rate is used uninitialized, and the "audio_clkout" clock will be created with an arbitrary clock rate. This uninitialized kernel stack data may leak to userspace through /sys/kernel/debug/clk/clk_summary, cfr. the value in the "rate" column: clock enable_cnt prepare_cnt rate accuracy phase -------------------------------------------------------------------- audio_clkout 0 0 4001836240 0 0 Signed-off-by: Geert Uytterhoeven Acked-by: Kuninori Morimoto --- Should the absence of this property be considered an error? Documentation/devicetree/bindings/sound/renesas,rsnd.txt states that both "#clock-cells" and "clock-frequency" are required properties, but none of the R-Car Gen1 and Gen2 DTSes seem to have them? --- sound/soc/sh/rcar/adg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/sh/rcar/adg.c b/sound/soc/sh/rcar/adg.c index 2a5b3a293cd243db..b123734f9fbdabd9 100644 --- a/sound/soc/sh/rcar/adg.c +++ b/sound/soc/sh/rcar/adg.c @@ -437,7 +437,7 @@ static void rsnd_adg_get_clkout(struct rsnd_priv *priv, struct device *dev = rsnd_priv_to_dev(priv); struct device_node *np = dev->of_node; u32 ckr, rbgx, rbga, rbgb; - u32 rate, req_rate, div; + u32 rate, req_rate = 0, div; uint32_t count = 0; unsigned long req_48kHz_rate, req_441kHz_rate; int i;