[alsa-devel] [PATCH V6 RESEND] ALSA: usb-audio: Scarlett Gen 2 mixer interface

Takashi Iwai tiwai at suse.de
Fri Jul 19 17:13:15 CEST 2019


On Fri, 19 Jul 2019 17:08:48 +0200,
Geoffrey D. Bennett wrote:
> 
> Hi Takashi,
> 
> On Thu, Jul 18, 2019 at 05:53:13PM +0200, Takashi Iwai wrote:
> [...]
> > Thanks, the patch looks almost good, but it's already too late for
> > 5.3, so I'm going to queue this for 5.4 after 5.3 merge window is
> > closed in this week.
> 
> Thank you. I really appreciate your assistance and feedback.
> 
> > But, before that, maybe one more refresh would be appreciated.
> > Namely,
> > 
> > - We need a verification of the fixed pipe before actually submitting
> >   urb.  scarlett2_usb() calls with usb_sndctrlpipe(), and this pipe
> >   has to be verified beforehand.  See the commit 801ebf1043ae for
> >   details.
> 
> I had a look at that commit, and I think I don't need to change
> scarlett2_usb() because it calls snd_usb_ctl_msg() which already calls
> the snd_usb_pipe_sanity_check() function to verify the pipe.

Ah right, then it's superfluous.

> I'm thinking though that scarlett2_mixer_status_create() which does
> something like this:
> 
>   struct usb_device *dev = mixer->chip->dev;
>   unsigned int pipe = usb_rcvintpipe(dev, SCARLETT2_USB_INTERRUPT_ENDPOINT);
>   ...
>   usb_fill_int_urb(mixer->urb, dev, pipe, ...);
>   usb_submit_urb(mixer->urb, GFP_KERNEL);
> 
> probably needs this added:
> 
>   if (snd_usb_pipe_sanity_check(dev, pipe))
>           return -EINVAL;
> 
> Do you agree?

Yes, if you call directly, you need the verification.


thanks,

Takashi


More information about the Alsa-devel mailing list