Skip to content

Commit c5ae57b

Browse files
committed
ALSA: gus: Fix kctl->id initialization
GUS driver replaces the kctl->id.index after assigning the kctl via snd_ctl_add(). This doesn't work any longer with the new Xarray lookup change. It has to be set before snd_ctl_add() call instead. Fixes: c27e1ef ("ALSA: control: Use xarray for faster lookups") Cc: <[email protected]> Reviewed-by: Jaroslav Kysela <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent f2f312a commit c5ae57b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/isa/gus/gus_pcm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,10 +892,10 @@ int snd_gf1_pcm_new(struct snd_gus_card *gus, int pcm_dev, int control_index)
892892
kctl = snd_ctl_new1(&snd_gf1_pcm_volume_control1, gus);
893893
else
894894
kctl = snd_ctl_new1(&snd_gf1_pcm_volume_control, gus);
895+
kctl->id.index = control_index;
895896
err = snd_ctl_add(card, kctl);
896897
if (err < 0)
897898
return err;
898-
kctl->id.index = control_index;
899899

900900
return 0;
901901
}

0 commit comments

Comments
 (0)