[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 <stsp@aknet.ru>
This commit is contained in:
Stas Sergeev 2004-09-15 18:44:24 +00:00 committed by Takashi Iwai
parent 8a42294dc4
commit 6f515096d9

View file

@ -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;
}