Skip to content

Commit 5d1b712

Browse files
jhovoldtiwai
authored andcommitted
ALSA: usb-audio: fix sync-ep altsetting sanity check
The altsetting sanity check in set_sync_ep_implicit_fb_quirk() was checking for there to be at least one altsetting but then went on to access the second one, which may not exist. This could lead to random slab data being used to initialise the sync endpoint in snd_usb_add_endpoint(). Fixes: c75a8a7 ("ALSA: snd-usb: add support for implicit feedback") Fixes: ca10a7e ("ALSA: usb-audio: FT C400 sync playback EP to capture EP") Fixes: 5e35dc0 ("ALSA: usb-audio: add implicit fb quirk for Behringer UFX1204") Fixes: 17f08b0 ("ALSA: usb-audio: add implicit fb quirk for Axe-Fx II") Fixes: 103e962 ("ALSA: usb-audio: simplify set_sync_ep_implicit_fb_quirk") Cc: stable <[email protected]> # 3.5 Signed-off-by: Johan Hovold <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 3e2dc6b commit 5d1b712

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/usb/pcm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs,
370370
add_sync_ep_from_ifnum:
371371
iface = usb_ifnum_to_if(dev, ifnum);
372372

373-
if (!iface || iface->num_altsetting == 0)
373+
if (!iface || iface->num_altsetting < 2)
374374
return -EINVAL;
375375

376376
alts = &iface->altsetting[1];

0 commit comments

Comments
 (0)