]> git.alsa-project.org Git - alsa-lib.git/commitdiff
[ALSA-LIB] dmix: dont forget to return -EINVAL on errors
authorStas Sergeev <stsp@aknet.ru>
Wed, 15 Sep 2004 18:44:24 +0000 (18:44 +0000)
committerTakashi Iwai <tiwai@suse.de>
Wed, 15 Sep 2004 18:44:24 +0000 (18:44 +0000)
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>
src/pcm/pcm_dmix.c

index ddb8dc746c3e0a02a48c6c8fa765ff0320f55742..5e4fa373cd6f1ff22631d7f59d34ee064e972e6d 100644 (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;
                }