From: Stas Sergeev Date: Wed, 15 Sep 2004 18:44:24 +0000 (+0000) Subject: [ALSA-LIB] dmix: dont forget to return -EINVAL on errors X-Git-Tag: v1.0.7~24 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=6f515096d918437eb21264e8c95dbe0ce3b59536;p=alsa-lib.git [ALSA-LIB] dmix: dont forget to return -EINVAL on errors snd_pcm_dmix_open() returns success if the open fails attempting to open not the HW plugin (dmix seems to be limited to use only the HW plugin right now). This leads to memory corruptions and eventually a SIGSEGV. The attached patch fixes the omission. Signed-off-by: Stas Sergeev --- diff --git a/src/pcm/pcm_dmix.c b/src/pcm/pcm_dmix.c index ddb8dc74..5e4fa373 100644 --- a/src/pcm/pcm_dmix.c +++ b/src/pcm/pcm_dmix.c @@ -871,6 +871,7 @@ int snd_pcm_dmix_open(snd_pcm_t **pcmp, const char *name, if (snd_pcm_type(spcm) != SND_PCM_TYPE_HW) { SNDERR("dmix plugin can be only connected to hw plugin"); + ret = -EINVAL; goto _err; }