From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756035AbdJJJWq (ORCPT ); Tue, 10 Oct 2017 05:22:46 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:51752 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755134AbdJJJWp (ORCPT ); Tue, 10 Oct 2017 05:22:45 -0400 From: Arnd Bergmann To: Mark Brown Cc: Arnd Bergmann , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Charles Keepax , anish kumar , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] ASoC: dapm: add initialization for w_param_text pointer Date: Tue, 10 Oct 2017 11:20:10 +0200 Message-Id: <20171010092052.2551973-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:mqMl7zQFI8PUR34PliPibOWgsJV8dl9g6+TdgVGZ3j2QL3ylLxP KkS2a5eghQ3loL3AhqM1M6O81ZvqLHtqO6cokFwe0D1pA0B5CY1Uly5HmXKY43UxJw1Xk2z Q905EP63VZrPKtGaeClod2PWHo40Uj2u6MykkAjreJIyLUJ5alm9eTh2bDPRdjTFarsFjnK ouE5QDtxD9esWV5glSvzA== X-UI-Out-Filterresults: notjunk:1;V01:K0:swvIknmie8g=:IsKW7DxKziDyVL/YfqGox+ JJYyR93sxcVnFg+vbX0XULY5iyx6Tb1S2+Bq4pYu4iCheygMZHhT7/2vd60ax8vEo9aIcBI2o 2i52F6qs8ZLto6R/AWXeIP9ny3bMthknMdli22vbvodega4GhB0czQ2N9WFZ5QCCEp8ccTgr3 fl1UTLp+ac8i22Kq/uimbuICX7ffOAEIbCZskUSlnHA3l1YVrye8yRKQb+cfSU01QgMlPeIy5 RE5iCcykq4hJi38b+yHb9aiYx1r8i6MTRPOozdffqAiDFWtl/h6PO2M4P6jMj08rGPOLSvRIp PQbLhnP1foRzeK4PNey57VmIO/WW2EBE5Twqe8SRwEo2uQlz/VzthUNURG83gVPSiikmxDr2V I6KXu+d4J9SxfF7OWMdCfqzaBSdXIYJGEZyL9fTl6sWu/Ie/pQ7/iY7gKWXU22/aBk6pFxhjB XlzBsUyfn2gRtUigtDRdXU1cuofT4uco7oT0ky85Spec48Lsto9tMuclbXJr+bvTiU3Zlh3VP gIE3/TFb3YLr0EClC+Fw1hl9hvy7dmbQXsfZu/hdJErsfkeiQJlTejwFxliA9uy8OWf+6WBzL aQM7D+jt6sCTMysG0WoS+a+OJAuXJxKPWrKBVEik4jIxLXa722ovua22soCR+JBxFsnNmHPzD wUlD0Pic4qAxw+xQNAMoOZzP0hSakTzXGaQu5WF6bhpQTYamIov8g0nKlZFUdm2qIJ1/F9Pfh LObd1Jvtfc/0W34hFAXSvoE3cKmL8HblWq35zA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We now allocate the array conditionally, but we always pass the pointer to the new snd_soc_dapm_free_kcontrol() function, which introduces a warning for the case that it is not initialized: sound/soc/soc-dapm.c: In function 'snd_soc_dapm_new_pcm': sound/soc/soc-dapm.c:3940:2: error: 'w_param_text' may be used uninitialized in this function [-Werror=maybe-uninitialized] As snd_soc_dapm_free_kcontrol() is global, it doesn't get inlined and gcc fails to notice that we don't actually access the array in that case, so the code is actually safe. Adding an initialization for the array pointer shuts up the warning. Fixes: 19ad683abc85 ("ASoC: dapm: Avoid creating kcontrol for params") Signed-off-by: Arnd Bergmann --- sound/soc/soc-dapm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index ceec185c871f..19babdae1a06 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -3905,6 +3905,8 @@ int snd_soc_dapm_new_pcm(struct snd_soc_card *card, ret = -ENOMEM; goto param_fail; } + } else { + w_param_text = NULL; } dev_dbg(card->dev, "ASoC: adding %s widget\n", link_name); -- 2.9.0