mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 22:26:55 +00:00
ALSA: aloop: Fix initialization of controls
commit 168632a495
upstream.
Add a control to the card before copying the id so that the numid field
is initialized in the copy. Otherwise the numid field of active_id,
format_id, rate_id and channels_id will be the same (0) and
snd_ctl_notify() will not queue the events properly.
Signed-off-by: Jonas Holmberg <jonashg@axis.com>
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210407075428.2666787-1-jonashg@axis.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
958e517f4e
commit
8cf440ffbb
1 changed files with 8 additions and 3 deletions
|
@ -1062,6 +1062,14 @@ static int loopback_mixer_new(struct loopback *loopback, int notify)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
kctl->id.device = dev;
|
kctl->id.device = dev;
|
||||||
kctl->id.subdevice = substr;
|
kctl->id.subdevice = substr;
|
||||||
|
|
||||||
|
/* Add the control before copying the id so that
|
||||||
|
* the numid field of the id is set in the copy.
|
||||||
|
*/
|
||||||
|
err = snd_ctl_add(card, kctl);
|
||||||
|
if (err < 0)
|
||||||
|
return err;
|
||||||
|
|
||||||
switch (idx) {
|
switch (idx) {
|
||||||
case ACTIVE_IDX:
|
case ACTIVE_IDX:
|
||||||
setup->active_id = kctl->id;
|
setup->active_id = kctl->id;
|
||||||
|
@ -1078,9 +1086,6 @@ static int loopback_mixer_new(struct loopback *loopback, int notify)
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
err = snd_ctl_add(card, kctl);
|
|
||||||
if (err < 0)
|
|
||||||
return err;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue