From: Takashi Iwai Subject: Re: [PATCH] ALSA: snd-usb: fix clock source validity index Date: Wed, 01 Aug 2012 10:26:04 +0200 Message-ID: References: <1343809013-22858-1-git-send-email-zonque@gmail.com> 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 mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id A2A77264FC1 for ; Wed, 1 Aug 2012 10:26:02 +0200 (CEST) In-Reply-To: <1343809013-22858-1-git-send-email-zonque@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Daniel Mack Cc: alsa-devel@alsa-project.org, clemens@ladisch.de, stable@kernel.org List-Id: alsa-devel@alsa-project.org At Wed, 1 Aug 2012 10:16:53 +0200, Daniel Mack wrote: > > uac_clock_source_is_valid() uses the control selector value to access > the bmControls bitmap of the clock source unit. This is wrong, as > control selector values start from 1, while the bitmap uses all > available bits. > > In other words, "Clock Validity Control" is stored in D3..2, not D5..4 > of the clock selector unit's bmControls. > > Signed-off-by: Daniel Mack > Reported-by: Andreas Koch > Cc: stable@kernel.org Applied now. Thanks. Takashi > --- > sound/usb/clock.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/sound/usb/clock.c b/sound/usb/clock.c > index 379baad..5e634a2 100644 > --- a/sound/usb/clock.c > +++ b/sound/usb/clock.c > @@ -111,7 +111,8 @@ static bool uac_clock_source_is_valid(struct snd_usb_audio *chip, int source_id) > return 0; > > /* If a clock source can't tell us whether it's valid, we assume it is */ > - if (!uac2_control_is_readable(cs_desc->bmControls, UAC2_CS_CONTROL_CLOCK_VALID)) > + if (!uac2_control_is_readable(cs_desc->bmControls, > + UAC2_CS_CONTROL_CLOCK_VALID - 1)) > return 1; > > err = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC2_CS_CUR, > -- > 1.7.11.2 >