From: Takashi Sakamoto Date: Mon, 11 Jul 2016 12:06:01 +0000 (+0900) Subject: pcm: set error code at failure path X-Git-Tag: v1.1.2~85 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=773eeda110bcc91b1f0c7796810162c0b278edcf;p=alsa-lib.git pcm: set error code at failure path 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 Signed-off-by: Takashi Iwai --- diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c index 4f4b84b2..1fe307f5 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;