Skip to content

Commit fa4e7a6

Browse files
committed
ALSA: usb-audio: Fix regression on detection of Roland VS-100
It's been reported that the recent kernel can't probe the PCM devices on Roland VS-100 properly, and it turned out to be a regression by the recent addition of the bit shift range check for the format bits. In the old code, we just did bit-shift and it resulted in zero, which is then corrected to the standard PCM format, while the new code explicitly returns an error in such a case. For addressing the regression, relax the check and fallback to the standard PCM type (with the info output). Fixes: 43d5ca8 ("ALSA: usb-audio: Fix potential out-of-bounds shift") Cc: <[email protected]> Link: https://bugzilla.kernel.org/show_bug.cgi?id=217084 Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 5f4efc9 commit fa4e7a6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sound/usb/format.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,12 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip,
3939
case UAC_VERSION_1:
4040
default: {
4141
struct uac_format_type_i_discrete_descriptor *fmt = _fmt;
42-
if (format >= 64)
43-
return 0; /* invalid format */
42+
if (format >= 64) {
43+
usb_audio_info(chip,
44+
"%u:%d: invalid format type 0x%llx is detected, processed as PCM\n",
45+
fp->iface, fp->altsetting, format);
46+
format = UAC_FORMAT_TYPE_I_PCM;
47+
}
4448
sample_width = fmt->bBitResolution;
4549
sample_bytes = fmt->bSubframeSize;
4650
format = 1ULL << format;

0 commit comments

Comments
 (0)