Otherwise, they will linger after the error is returned (but pcm->setup == 0).
Then, if the caller tries to clean up and call snd_pcm_close(), the assertion
plug->gen.slave == plug->req_slave will fail.
Signed-off-by: Michael Forney <mforney@mforney.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(plug->ttable && !plug->ttable_ok)) {
snd_pcm_t *new;
int err;
- if (k >= sizeof(funcs)/sizeof(*funcs))
+ if (k >= sizeof(funcs)/sizeof(*funcs)) {
+ snd_pcm_plug_clear(pcm);
return -EINVAL;
+ }
err = funcs[k](pcm, &new, client, &p);
if (err < 0) {
snd_pcm_plug_clear(pcm);