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>
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);