From patchwork Fri Jun 30 10:50:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 9819239 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 DAFFC60224 for ; Fri, 30 Jun 2017 10:58:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA9CF2861A for ; Fri, 30 Jun 2017 10:58:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE3B02861C; Fri, 30 Jun 2017 10:58:15 +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.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham 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 2238B2861A for ; Fri, 30 Jun 2017 10:58:14 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 5178B26733B; Fri, 30 Jun 2017 12:50:10 +0200 (CEST) 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 819BF26733B; Fri, 30 Jun 2017 12:50:08 +0200 (CEST) Received: from smtp-proxy004.phy.lolipop.jp (smtp-proxy004.phy.lolipop.jp [157.7.104.45]) by alsa0.perex.cz (Postfix) with ESMTP id 7AC36266EB6 for ; Fri, 30 Jun 2017 12:50:04 +0200 (CEST) Received: from smtp-proxy004.phy.lolipop.lan (HELO smtp-proxy004.phy.lolipop.jp) (172.19.44.45) (smtp-auth username m12129643-o-takashi, mechanism plain) by smtp-proxy004.phy.lolipop.jp (qpsmtpd/0.82) with ESMTPA; Fri, 30 Jun 2017 19:50:02 +0900 Received: from 127.0.0.1 (127.0.0.1) by smtp-proxy004.phy.lolipop.jp (LOLIPOP-Fsecure); Fri, 30 Jun 2017 19:50:00 +0900 (JST) X-Virus-Status: clean(LOLIPOP-Fsecure) From: Takashi Sakamoto To: tiwai@suse.de Date: Fri, 30 Jun 2017 19:50:00 +0900 Message-Id: <20170630105000.5882-1-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH alsa-lib] pcm: hw: fix to initialize function local variable 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 This commit is to fix below warning. pcm_hw.c: In function ‘snd1_pcm_hw_open_fd’: pcm_hw.c:955:33: warning: ‘mmap_control’ may be used uninitialized in this function [-Wmaybe-uninitialized] if (mmap_control == MAP_FAILED || mmap_control == NULL) { ^ pcm_hw.c:946:31: note: ‘mmap_control’ was declared here struct snd_pcm_mmap_control *mmap_control; ^~~~~~~~~~~~ Signed-off-by: Takashi Sakamoto --- src/pcm/pcm_hw.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c index 64188b22..e0931577 100644 --- a/src/pcm/pcm_hw.c +++ b/src/pcm/pcm_hw.c @@ -904,6 +904,7 @@ static bool map_control_data(snd_pcm_hw_t *hw, struct snd_pcm_mmap_control *mmap_control; bool fallbacked; + mmap_control = MAP_FAILED; if (!force_fallback) { mmap_control = mmap(NULL, page_align(sizeof(*mmap_control)), PROT_READ|PROT_WRITE, MAP_FILE|MAP_SHARED,