diff options
author | David Henningsson <david.henningsson@canonical.com> | 2014-05-27 09:51:21 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-05-27 11:21:52 +0200 |
commit | 84f8b976c052254a3e80bcf0eb0f198a480b2988 (patch) | |
tree | f1f65169f1ba2826f83f50c5a0bb6455d33443da | |
parent | 80a43f23dbca7a440cc95f73feecf20516eb99de (diff) | |
download | alsa-lib-84f8b976c052254a3e80bcf0eb0f198a480b2988.tar.gz |
pcm: route: Correctly close slave pcm when no matching chmap is found
This patch fixes a bug where the slave pcm was not correctly closed
on some error conditions, such as not finding a matching chmap.
Reported-by: Raymond Yau <superquad.vortex2@gmail.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | src/pcm/pcm_route.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pcm/pcm_route.c b/src/pcm/pcm_route.c index 49567ea1..751e36f2 100644 --- a/src/pcm/pcm_route.c +++ b/src/pcm/pcm_route.c @@ -1429,8 +1429,10 @@ int _snd_pcm_route_open(snd_pcm_t **pcmp, const char *name, if (tt_chmap) { err = find_matching_chmap(spcm, tt_chmap, &chmap, &schannels); free(tt_chmap); - if (err < 0) + if (err < 0) { + snd_pcm_close(spcm); return err; + } } err = _snd_pcm_route_determine_ttable(tt, &csize, &ssize, chmap); |