From patchwork Thu Feb 21 09:42:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 10823655 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 13F801399 for ; Thu, 21 Feb 2019 10:43:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00128307E5 for ; Thu, 21 Feb 2019 10:43:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5381307F8; Thu, 21 Feb 2019 10:43:42 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B556C307E5 for ; Thu, 21 Feb 2019 10:43:41 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id EAA0815EB; Thu, 21 Feb 2019 11:42:49 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz EAA0815EB Authentication-Results: alsa0.perex.cz; dkim=fail reason="signature verification failed" (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="GihyNa4Y" Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 52379F89634; Thu, 21 Feb 2019 11:31:48 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 52379F89634 Authentication-Results: alsa1.perex.cz; dkim=fail reason="signature verification failed" (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="GihyNa4Y" X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id BA92EF80776; Thu, 21 Feb 2019 10:43:07 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BA92EF80776 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 5C6B6F806EA for ; Thu, 21 Feb 2019 10:43:01 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5C6B6F806EA Received: from epcas1p2.samsung.com (unknown [182.195.41.46]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20190221094256epoutp017d38179c66a02182d6bd6adc123fefc9~FV8sBJwuH0683806838epoutp01i; Thu, 21 Feb 2019 09:42:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20190221094256epoutp017d38179c66a02182d6bd6adc123fefc9~FV8sBJwuH0683806838epoutp01i DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1550742176; bh=YP9KvWTI9A4be0gsg1SEl41NIWxvoRMvktLdJnx2Ezc=; h=From:To:Cc:Subject:Date:References:From; b=GihyNa4YrO1zfk81widVocipRlmBjh7fCSdQBPKI+EPdCGVvPaGUecW+SzP8IHMii X6OFLMxT5ylB7cnIPj+ka+lpIGPMLOaZGEUfurdikq+PAfTvEJ7rHmCviRGIag1GTB thI22FtJNKHRV0d9aDfC6VXzD3yrNS6gRAAdLuQE= Received: from epsmges1p1.samsung.com (unknown [182.195.42.53]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20190221094255epcas1p3a6d873cb0d73289f6f788ef4dc259975~FV8ruXX8x1776117761epcas1p3k; Thu, 21 Feb 2019 09:42:55 +0000 (GMT) Received: from epcas1p3.samsung.com ( [182.195.41.47]) by epsmges1p1.samsung.com (Symantec Messaging Gateway) with SMTP id 50.27.04074.F927E6C5; Thu, 21 Feb 2019 18:42:55 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20190221094255epcas1p434e428e3470a8ae9963e8acd3e0c7532~FV8rB3so42236922369epcas1p4E; Thu, 21 Feb 2019 09:42:55 +0000 (GMT) X-AuditID: b6c32a35-27fff70000000fea-3a-5c6e729fb7f9 Received: from epmmp1.local.host ( [203.254.227.16]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 12.A8.04015.E927E6C5; Thu, 21 Feb 2019 18:42:55 +0900 (KST) MIME-version: 1.0 Received: from AMDC3061.digital.local ([106.116.147.40]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PN900LKXSAV4D80@mmp1.samsung.com>; Thu, 21 Feb 2019 18:42:53 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org, lgirdwood@gmail.com Date: Thu, 21 Feb 2019 10:42:28 +0100 Message-id: <20190221094228.3778-1-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrNIsWRmVeSWpSXmKPExsWy7bCmvu78orwYg+8duhZXLh5ispj68Amb xfnzG9gtvl3pYLK4vGsOm8WM8/uYLA6/aWe1uLjiC5MDh8eGz01sHjtn3WX32LSqk82jb8sq Ro/Pm+QCWKO4bFJSczLLUov07RK4Mn7tecZY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rEj1tn2SB2WUn8 vPaRFeIgeYnVGw4wT2DknYXkjFkIZ8xCcsYCRuZVjJKpBcW56bnFRgWGeanlesWJucWleel6 yfm5mxiBwbrtsFbfDsb7S+IPMQpwMCrx8HJE58YIsSaWFVfmHmKU4GBWEuH1ysyLEeJNSays Si3Kjy8qzUktPsQozcGiJM57O+9YpJBAemJJanZqakFqEUyWiYNTqoExOy/LSHSfRmfWhbQp b06tDkhg4pDdYHBSaTlPGP+WINcSx0UvspQ3fzqk+6r7rklGyvwnn859Ld5+br9W5PzeG3uY q51NNL01vkb9sWU+HuR5Od75wVZlj90HnVVCjsR298Q/8hQ7Lh9e4vlum6vNrxN+JeZ//e9r z/76PZD3cavH+nlGRe+UWIozEg21mIuKEwEb6SjSUgIAAA== X-CMS-MailID: 20190221094255epcas1p434e428e3470a8ae9963e8acd3e0c7532 CMS-TYPE: 101P X-CMS-RootMailID: 20190221094255epcas1p434e428e3470a8ae9963e8acd3e0c7532 References: Cc: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, sbkim73@samsung.com, linux-kernel@vger.kernel.org, krzk@kernel.org, Sylwester Nawrocki Subject: [alsa-devel] [PATCH] ASoC: samsung: odroid: Prevent uninitialized variable use X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" X-Virus-Scanned: ClamAV using ClamSMTP This addresses an issue pointed out by compiler warning: sound/soc/samsung/odroid.c: In function ‘odroid_audio_probe’: sound/soc/samsung/odroid.c:298:22: warning: ‘cpu_dai’ may be used uninitialized in this function [-Wmaybe-uninitialized] priv->clk_i2s_bus = of_clk_get_by_name(cpu_dai, "iis"); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Sylwester Nawrocki --- sound/soc/samsung/odroid.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sound/soc/samsung/odroid.c b/sound/soc/samsung/odroid.c index c3b0f6c612cb..694512f980fd 100644 --- a/sound/soc/samsung/odroid.c +++ b/sound/soc/samsung/odroid.c @@ -194,7 +194,8 @@ static struct snd_soc_dai_link odroid_card_dais[] = { static int odroid_audio_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct device_node *cpu, *cpu_dai, *codec; + struct device_node *cpu_dai = NULL; + struct device_node *cpu, *codec; struct odroid_priv *priv; struct snd_soc_card *card; struct snd_soc_dai_link *link, *codec_link; @@ -271,8 +272,11 @@ static int odroid_audio_probe(struct platform_device *pdev) if (ret < 0) break; } - if (ret == 0) + if (ret == 0) { cpu_dai = of_parse_phandle(cpu, "sound-dai", 0); + if (!cpu_dai) + ret = -EINVAL; + } of_node_put(cpu); of_node_put(codec);