Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp10642353pxu; Wed, 30 Dec 2020 07:47:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJy8xzJQGKeIZru+YzOmdcSa+CeU8/QL61D3t5z7lYEg4a32q1M2JPmuvSsa7EXTOIUyVyRB X-Received: by 2002:a50:aac8:: with SMTP id r8mr50216387edc.9.1609343241803; Wed, 30 Dec 2020 07:47:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609343241; cv=none; d=google.com; s=arc-20160816; b=lEoTCdN+2FKEuSbs5V8wsrgXCW4k9UuqfRxkIzQEXeFnqd09UlchqA8jbkQWubqYhJ +6LHTkP/xVVPSxZuYPpISho2j/JKGO/na4gcSElS/u5KajzgtGPEQEY/1nNwbLThqZFL 1SfqpRSB2sfh/Ct8xu3H4va/O5mzP7d0Cmp6Wxnl3Q0drHprJXQi2G7U3gVp2H4XaNeD wX8KoNlG+SHPu+YKdkDkyYf6thInR3LAoJXTE0DLR7AlLBzQYN0TDhOA/1Fbn7ywHD/X scrm/F1tYmNCvnL3M0AwdgNZLbhY6JHMcwQz5ubr6pNxwEajCeHFvuWAaA7V0jWGufJ9 3/7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=AL/tMDhvZLKoDh7YO+OfDb1+N9GOVI/ovuuABNu2M8A=; b=CAGD5utHT9JbQ95zuc+m6OAJkh6lwTVVbw5d2psxVlP55k80g0tC+8fjEC+FriDYbH ofRMpM9A1vmaI7T0OeLGyIUmy9beVrGapEQ11qFJr7UHkl266jtSOvU4RONaaiIV2d69 vcIb7vpyc1aMcl0qOnu4lUnlMr3HxjQSkXXs31swVVY4NolIAICkQQKx/ZQNUJ8n0meh KXQoT8ygrIlLw7Y4fXJGWm6DIIdPjKTR0aBw7Od4byf0LS3564Zw3DftE64NoD0KBJXq zXO8f9F1HvAi1UUCwXpxr9U4qZuH15zq8AZlIP3WG5YPuMiZS4X/be7Lb1LtKQhJ03YB dZpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HCKeDJ0K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jg21si9570592ejc.418.2020.12.30.07.46.57; Wed, 30 Dec 2020 07:47:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HCKeDJ0K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726247AbgL3Ppa (ORCPT + 99 others); Wed, 30 Dec 2020 10:45:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:45784 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725853AbgL3Pp3 (ORCPT ); Wed, 30 Dec 2020 10:45:29 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 413BD20725; Wed, 30 Dec 2020 15:44:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1609343088; bh=B6KEEyF4RQKJhn/Tlgm2gPhwOX1a1c48tzMAbskoqNY=; h=From:To:Cc:Subject:Date:From; b=HCKeDJ0KSZ7nc1CoEISb/ZRNzccPTaWWh06Nn2VIZBsId6eP9cn0oGFUJlOABZZZO iI0X3/jv9pxyQ5bU7W/XqVpiwAVKTetRviaE1CBU80GpLg/jmLlz66OeoO4ZhibBqQ PjjjdalMW1Zz2BoWMBZ8kelnigjz4DMVLkz9RLZvfhx2BBPns1SB0TRK+cYujQxlOH 8MnDwDJqOqRtqV2yMQCPacw1DfF9pBrJ/RhsJA8R+VJ3BdV7xvpCIPfiT77gwd3boZ PiTBMWGGCaRfDf7RBRjRMAgbFOqHd28vArCHhJoja2QAirqWZnxT1vUTZKPDO8Anij h3IyOvDVmuzrg== From: Arnd Bergmann To: Timur Tabi , Nicolin Chen , Mark Brown Cc: Arnd Bergmann , Xiubo Li , Fabio Estevam , Shengjiu Wang , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , NXP Linux Team , Nathan Chancellor , Nick Desaulniers , alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: [PATCH] ASoC: fsl: fix -Wmaybe-uninitialized warning Date: Wed, 30 Dec 2020 16:44:15 +0100 Message-Id: <20201230154443.656997-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann Clang points out a code path that returns an undefined value in an error case: sound/soc/fsl/imx-hdmi.c:165:6: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsom etimes-uninitialized] if ((hdmi_out && hdmi_in) || (!hdmi_out && !hdmi_in)) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/fsl/imx-hdmi.c:212:9: note: uninitialized use occurs here return ret; The driver returns -EINVAL for other broken DT properties, so do it the same way here. Fixes: 6a5f850aa83a ("ASoC: fsl: Add imx-hdmi machine driver") Signed-off-by: Arnd Bergmann --- sound/soc/fsl/imx-hdmi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/fsl/imx-hdmi.c b/sound/soc/fsl/imx-hdmi.c index 2c2a76a71940..ede4a9ad1054 100644 --- a/sound/soc/fsl/imx-hdmi.c +++ b/sound/soc/fsl/imx-hdmi.c @@ -164,6 +164,7 @@ static int imx_hdmi_probe(struct platform_device *pdev) if ((hdmi_out && hdmi_in) || (!hdmi_out && !hdmi_in)) { dev_err(&pdev->dev, "Invalid HDMI DAI link\n"); + ret = -EINVAL; goto fail; } -- 2.29.2