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>
if (snd_pcm_type(spcm) != SND_PCM_TYPE_HW) {
SNDERR("dmix plugin can be only connected to hw plugin");
+ ret = -EINVAL;
goto _err;
}