Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2372359imm; Thu, 7 Jun 2018 09:31:29 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJg9MppoMx+GrTfvf72f7RCv3QMkMwkreloE5Bxyw4WL7V/NWPHgxLuLW3Tqoq8d4DkC0gx X-Received: by 2002:a17:902:5ac8:: with SMTP id g8-v6mr2691903plm.221.1528389089783; Thu, 07 Jun 2018 09:31:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528389089; cv=none; d=google.com; s=arc-20160816; b=MThzfzB/Nv7HTcW0je7h5EchFyqzgqV+VHKFLwc/8FQzXnyqhZ+G57vZpP8ZdNCGc+ 68infYppLc8TKZKwvJynI44w5jMfMz0MAptK00wFEcPWbww5JRSqrnYVywXCoFxStLeU b2H0a3oD5XGfnCgH7RaBPDZyWE4Z/ZJS48rgeqrNcqOcdQJw5y+L1Th9CFrN2Wrtbenw T1+vbJLGuoVJU5Q/QtUuL8fNWGBiEnytL6rWxJi33TFOoX2qixEMoE5NQYnUGGZqf+h0 aH5DtCzB0SiiDZef3DyaBnLEoVeqgjhINAGFBGkT7i82RO4dTepx0NVqoLyf0isRDg/J uKwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=OrDG/hYj9QjbN+iKVDhFhMPOjGxsy5IcmK6SfF6i6/8=; b=BrxiSitwmuF+Y7/8VZTqdgoQEtg6f2iEVOjhTWbnoV1JCUJfFZctj9C/Mv1eO4SBVk vdz0oVHSw3RVIEzdldQkxUJQPmMUKbkKw5fFq1pkM4vHJTGxoMpWiWc+KsNCwyvYJdnf plSAX/h/G1YMDdLN8KQAogWt6IvTd8vO9Lk2DXjEuFtMixlIGnhjMNi2FxxXYAps4K0m 7qtqzkRyD86CVJKT9VWqSXVQfdF1WGVw8aY/Z59F89eLkoegJvJwJO8RpeLewKAAYaDt R875gzxfQ1DFWsed61vMnRrr/kULVLraDkxEu9AsheTRkK6hm+BZwFwGNOCgq1/qUTKb lZxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s4-v6si10381527pfs.157.2018.06.07.09.31.15; Thu, 07 Jun 2018 09:31:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933235AbeFGOJv (ORCPT + 99 others); Thu, 7 Jun 2018 10:09:51 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:39442 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932829AbeFGOJg (ORCPT ); Thu, 7 Jun 2018 10:09:36 -0400 Received: from [148.252.241.226] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1fQvbM-0005Zl-R9; Thu, 07 Jun 2018 15:09:21 +0100 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1fQvbD-0003HR-TV; Thu, 07 Jun 2018 15:09:11 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Kirill Marinushkin" , "Takashi Iwai" Date: Thu, 07 Jun 2018 15:05:21 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 381/410] ALSA: usb-audio: Fix parsing descriptor of UAC2 processing unit In-Reply-To: X-SA-Exim-Connect-IP: 148.252.241.226 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.57-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Kirill Marinushkin commit a6618f4aedb2b60932d766bd82ae7ce866e842aa upstream. Currently, the offsets in the UAC2 processing unit descriptor are calculated incorrectly. It causes an issue when connecting the device which provides such a feature: ~~~~ [84126.724420] usb 1-1.3.1: invalid Processing Unit descriptor (id 18) ~~~~ After this patch is applied, the UAC2 processing unit inits w/o this error. Fixes: 23caaf19b11e ("ALSA: usb-mixer: Add support for Audio Class v2.0") Signed-off-by: Kirill Marinushkin Signed-off-by: Takashi Iwai Signed-off-by: Ben Hutchings --- include/uapi/linux/usb/audio.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/include/uapi/linux/usb/audio.h +++ b/include/uapi/linux/usb/audio.h @@ -369,7 +369,7 @@ static inline __u8 uac_processing_unit_b { return (protocol == UAC_VERSION_1) ? desc->baSourceID[desc->bNrInPins + 4] : - desc->baSourceID[desc->bNrInPins + 6]; + 2; /* in UAC2, this value is constant */ } static inline __u8 *uac_processing_unit_bmControls(struct uac_processing_unit_descriptor *desc, @@ -377,7 +377,7 @@ static inline __u8 *uac_processing_unit_ { return (protocol == UAC_VERSION_1) ? &desc->baSourceID[desc->bNrInPins + 5] : - &desc->baSourceID[desc->bNrInPins + 7]; + &desc->baSourceID[desc->bNrInPins + 6]; } static inline __u8 uac_processing_unit_iProcessing(struct uac_processing_unit_descriptor *desc,