[alsa-devel] [PATCH 5/7] pcm: set error code at failure path

Takashi Sakamoto o-takashi at sakamocchi.jp
Mon Jul 11 14:06:01 CEST 2016


This commit fixes below compiler warnings.

pcm_hw.c: In function ‘_snd_pcm_hw_open’:
pcm_hw.c:1816:16: warning: ‘err’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         return err;
                ^

Signed-off-by: Takashi Sakamoto <o-takashi at sakamocchi.jp>
---
 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 4f4b84b..1fe307f 100644
--- a/src/pcm/pcm_hw.c
+++ b/src/pcm/pcm_hw.c
@@ -1769,6 +1769,7 @@ int _snd_pcm_hw_open(snd_pcm_t **pcmp, const char *name,
 			chmap = _snd_pcm_parse_config_chmaps(n);
 			if (!chmap) {
 				SNDERR("Invalid channel map for %s", id);
+				err = -EINVAL;
 				goto fail;
 			}
 			continue;
-- 
2.7.4



More information about the Alsa-devel mailing list