From ec16d21f86abbc23a56abeed0419a5a863ee5400 Mon Sep 17 00:00:00 2001 From: Takashi Sakamoto Date: Fri, 30 Jun 2017 19:50:00 +0900 Subject: [PATCH] pcm: hw: fix to initialize function local variable MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Takashi Iwai --- 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, -- 2.47.1