From patchwork Tue Nov 8 13:38:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9417525 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2EAC06022E for ; Tue, 8 Nov 2016 13:58:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 213EE288A4 for ; Tue, 8 Nov 2016 13:58:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 15E5D288CA; Tue, 8 Nov 2016 13:58:12 +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=-1.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5ED64288BC for ; Tue, 8 Nov 2016 13:58:00 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 2EF8126680F; Tue, 8 Nov 2016 14:57:56 +0100 (CET) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id DCA092667CC; Tue, 8 Nov 2016 14:55:34 +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 A29492666A8; Tue, 8 Nov 2016 14:39:30 +0100 (CET) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.130]) by alsa0.perex.cz (Postfix) with ESMTP id 7DD42265119 for ; Tue, 8 Nov 2016 14:39:22 +0100 (CET) Received: from wuerfel.lan. ([78.43.20.153]) by mrelayeu.kundenserver.de (mreue003) with ESMTPA (Nemesis) id 0LcCDx-1cVDi90PTx-00jalg; Tue, 08 Nov 2016 14:39:20 +0100 From: Arnd Bergmann To: Mark Brown Date: Tue, 8 Nov 2016 14:38:52 +0100 Message-Id: <20161108133916.1742379-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 MIME-Version: 1.0 X-Provags-ID: V03:K0:CICNMZJaVusR+LZbDtonxYFzlIVZqfix1qwDrWfD0Gj34hwVMXI FIn5i6plb1nGPM3DfwIJLfyJcY8kr43QXshcvuamZYBsTQSdng8wTHP5JPESix5nby+dtMB A0Cw/j1lxbWLOjbRT1eU5SY3ADnTaaEq2Wx2A6ddV8ICXFgoTmGWATgTM8Ru3QUNcHYSCG+ i9TZGBcGg+LWd7t8kACWQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:pUAbsXqO8ck=:iHp4St2p2fcCCfV0ebzycZ 0GBi3rvtI0MKxjy5AIMZLeviISLWuAncllAPwcWsxsWVNU9663+rYE7tqOEVnDgJ3RgQlRjwd 89cWTip06w2Thh9L+BLJnLWIzpUsKtIQYtb1iu9U9F4HH/J1qZLLGlITuWg/BNCmOAVIQxIIu CVl2jIPJO8Xe3A4BEPYDRjh+WSeZNu3JkbnlFCzQmRPec/stzAqeBUG6NxS3aa3b8AOM2ehWj YTLc5Ayr70rT/jZxtD8i5ONvWjb9LAqeH2yzrtF6RCjl//XpsxBodwvxBGOYEtPSHtOI1534w N3/2cyg330VeHWgdXgJ+WEEH5ZveFyCUkC8NeWj2LAdy9VgMBguaWVYM1A3kSiEhQT8S9SsXy zseTlR5z2x7hug75T4donKlaLygSWBKlmlm0DFq+5cY1Gb1P9tOFWDCpVZN8hgQsbFL08ciTV UOVHdr6r666SyClosvYJLoGmDGGvmfUV0OZiL13myJdmVo6E+axG10pKaprj9e5jDNo2XTKga CvoIuba5orGDojRCT6Gg+rrY5+C9LmYgDsCLbrVLlRVGb149sDYqbsdZuw0OZxMBJVYSNy3UO 1HA5EN3CpSs7/CM4QraB3OaT23Hh5fBXwJnRMbHExyUc3EMT/bwRokQVgsQnFRV2dC7mEi43P 2cOAn0oiiJopc64RrIJwVGJk2/KORSI1wPZsN87873ulCU8PRAa5zJjSlA8zzKo5pBmxUfPZE WNS9stjvDkdMHoFf Cc: Kenneth Westfield , Banajit Goswami , Arnd Bergmann , Patrick Lai , Liam Girdwood , linux-kernel@vger.kernel.org, Srinivas Kandagatla , alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH] ASoC: lpass-platform: initialize dma channel number 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP A bugfix accidentally removed the implicit initialization of the dma channel number, causing undefined behavior when v->alloc_dma_channel is NULL: sound/soc/qcom/lpass-platform.c: In function ‘lpass_platform_pcmops_open’: sound/soc/qcom/lpass-platform.c:83:29: error: ‘dma_ch’ may be used uninitialized in this function [-Werror=maybe-uninitialized] This adds back an explicit initialization to zero, restoring the previous behavior for that case. Fixes: 022d00ee0b55 ("ASoC: lpass-platform: Fix broken pcm data usage") Signed-off-by: Arnd Bergmann Acked-by: Kenneth Westfield --- sound/soc/qcom/lpass-platform.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c index 07000f53db44..e223bc90b2ef 100644 --- a/sound/soc/qcom/lpass-platform.c +++ b/sound/soc/qcom/lpass-platform.c @@ -77,6 +77,9 @@ static int lpass_platform_pcmops_open(struct snd_pcm_substream *substream) if (v->alloc_dma_channel) dma_ch = v->alloc_dma_channel(drvdata, dir); + else + dma_ch = 0; + if (dma_ch < 0) return dma_ch;