From: Takashi Iwai Subject: Re: [PATCH V6 RESEND] ALSA: usb-audio: Scarlett Gen 2 mixer interface Date: Fri, 19 Jul 2019 17:13:15 +0200 Message-ID: References: <20190717155105.GA4198@b4.vu> <20190719150848.GA11924@b4.vu> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E7966F800B2 for ; Fri, 19 Jul 2019 17:13:16 +0200 (CEST) In-Reply-To: <20190719150848.GA11924@b4.vu> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" To: "Geoffrey D. Bennett" Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org 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