Commit e6ff3840 authored by Takashi Sakamoto's avatar Takashi Sakamoto Committed by Takashi Iwai

ALSA: control: fix failure to return new numerical ID in 'replace' event data

In 'replace' event data, numerical ID of control is always invalid. This
commit fix this bug so as the event data has renewed numerical ID for
control.
Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent ea33d359
...@@ -440,6 +440,7 @@ int snd_ctl_replace(struct snd_card *card, struct snd_kcontrol *kcontrol, ...@@ -440,6 +440,7 @@ int snd_ctl_replace(struct snd_card *card, struct snd_kcontrol *kcontrol,
card->controls_count += kcontrol->count; card->controls_count += kcontrol->count;
kcontrol->id.numid = card->last_numid + 1; kcontrol->id.numid = card->last_numid + 1;
card->last_numid += kcontrol->count; card->last_numid += kcontrol->count;
id = kcontrol->id;
count = kcontrol->count; count = kcontrol->count;
up_write(&card->controls_rwsem); up_write(&card->controls_rwsem);
for (idx = 0; idx < count; idx++, id.index++, id.numid++) for (idx = 0; idx < count; idx++, id.index++, id.numid++)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment