Skip to content

Commit

Permalink
ALSA: usb-audio: Use snd_usb_ctl_msg() for Native Instruments quirk
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Nov 20, 2014
1 parent 6676f30 commit 01cb156
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/usb/mixer_quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -593,10 +593,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) {
Expand Down

0 comments on commit 01cb156

Please sign in to comment.