Skip to contentSkip to conversation

ALSA: usb-audio: fix control-request direction

PATCH Applied Johan Hovold 2 participants 2 messages May 21, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: usb-audio: fix control-request direction

The direction of the pipe argument must match the request-type direction bit or control requests may fail depending on the host-controller-driver implementation.

Fix the UAC2_CS_CUR request which erroneously used usb_sndctrlpipe().

Fixes 93db51d06b32 ("ALSA: usb-audio: Check valid altsetting at parsing rates for UAC2/3")

---

There's a related bug in sound/usb/mixer_scarlett_gen2.c, which Geoffrey reported and said he was preparing a patch for here:

	https://lore.kernel.org/r/[email protected]

Johan

 sound/usb/format.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/usb/format.c +1 -1
index e6ff317a6785..2287f8c65315 100644
@@ -436,7 +436,7 @@ static bool check_valid_altsetting_v2v3(struct snd_usb_audio *chip, int iface,
 	if (snd_BUG_ON(altsetting >= 64 - 8))
 		return false;
 
-	err = snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0), UAC2_CS_CUR,
+	err = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC2_CS_CUR,
 			      USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_IN,
 			      UAC2_AS_VAL_ALT_SETTINGS << 8,
 			      iface, &raw_data, sizeof(raw_data));
Signature · 1 line
2.26.3
Applied
#1 lore raw
Quoted 10 lines · Johan Hovold

The direction of the pipe argument must match the request-type direction bit or control requests may fail depending on the host-controller-driver implementation.

Fix the UAC2_CS_CUR request which erroneously used usb_sndctrlpipe().

Fixes 93db51d06b32 ("ALSA: usb-audio: Check valid altsetting at parsing rates for UAC2/3")

Thanks, applied now.

Quoted 6 lines

---

There's a related bug in sound/usb/mixer_scarlett_gen2.c, which Geoffrey reported and said he was preparing a patch for here:

	https://lore.kernel.org/r/[email protected]

Yes, I'm going to apply them now, too.

Takashi