Skip to content

Commit aff252a

Browse files
zonquetiwai
authored andcommitted
ALSA: snd-usb: fix clock source validity index
uac_clock_source_is_valid() uses the control selector value to access the bmControls bitmap of the clock source unit. This is wrong, as control selector values start from 1, while the bitmap uses all available bits. In other words, "Clock Validity Control" is stored in D3..2, not D5..4 of the clock selector unit's bmControls. Signed-off-by: Daniel Mack <zonque@gmail.com> Reported-by: Andreas Koch <andreas@akdesigninc.com> Cc: stable@kernel.org Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 1f43f6c commit aff252a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sound/usb/clock.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ static bool uac_clock_source_is_valid(struct snd_usb_audio *chip, int source_id)
111111
return 0;
112112

113113
/* If a clock source can't tell us whether it's valid, we assume it is */
114-
if (!uac2_control_is_readable(cs_desc->bmControls, UAC2_CS_CONTROL_CLOCK_VALID))
114+
if (!uac2_control_is_readable(cs_desc->bmControls,
115+
UAC2_CS_CONTROL_CLOCK_VALID - 1))
115116
return 1;
116117

117118
err = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC2_CS_CUR,

0 commit comments

Comments
 (0)