Skip to contentSkip to conversation

ALSA: usb-audio: Use snd_usb_ctl_msg() for Native Instruments quirk

PATCH New Takashi Iwai 1 participant 1 message Nov 20, 2014 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: usb-audio: Use snd_usb_ctl_msg() for Native Instruments quirk

snd_nativeinstruments_control_get() uses a stack as a buffer for usb_control_msg(), but it's basically not allowed. Replace the call with a safer helper, snd_usb_ctl_msg(), instead.

---
 sound/usb/mixer_quirks.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/usb/mixer_quirks.c +2 -2
index 03405b93b438..8b55c0667f60 100644
@@ -702,10 +702,10 @@ static int snd_nativeinstruments_control_get(struct snd_kcontrol *kcontrol,
 	if (mixer->chip->shutdown)
 		ret = -ENODEV;
 	else
-		ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), bRequest,
+		ret = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), bRequest,
 				  USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
 				  0, wIndex,
-				  &tmp, sizeof(tmp), 1000);
+				  &tmp, sizeof(tmp));
 	up_read(&mixer->chip->shutdown_rwsem);
 
 	if (ret < 0) {
Signature · 1 line
2.1.3