From 6f515096d918437eb21264e8c95dbe0ce3b59536 Mon Sep 17 00:00:00 2001 From: Stas Sergeev Date: Wed, 15 Sep 2004 18:44:24 +0000 Subject: [PATCH] [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 --- src/pcm/pcm_dmix.c | 1 + 1 file changed, 1 insertion(+) 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; } -- 2.47.1