Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5287339imu; Tue, 15 Jan 2019 14:55:01 -0800 (PST) X-Google-Smtp-Source: ALg8bN4XKwIvQGdBYIow8ElMANrHa/JDFyP/kHCRLzmzmjhiu8+kDE8DJUcU9IruKIRz/oL67a9X X-Received: by 2002:a17:902:968d:: with SMTP id n13mr6624495plp.109.1547592901237; Tue, 15 Jan 2019 14:55:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547592901; cv=none; d=google.com; s=arc-20160816; b=bbI0bLFsyahtZdKsdupBLgylXQf2hXbUr8/uw3k+ezABWghf8bjoAETT1yH1mE0rfj 3Yl84r4XcnZqNWchMLsZPoXJhLY59L/FxmwWtLJL/ueqaNK5V4ER4cSFVIbwefrk7h7u fE98/FICowEUJdu2aNf894BnlBXUd8x9D25Ps+/eRuiEtT+CIBGYBXgg39fHSNcXKDtQ pkMInv3C00RVkS95K5oFTlZ0Zh28/I2zXBfRApmuDJwK1+pKpFOTH6YbA4rKCAcM0WTl lOzfAjjcxLvRMC/5Uxh3M5cEsxixA30OwGHu4/89fV8jXGbXsFDoqSMvyHSgXhJLUFhB npgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wrNWy1rllzSbezCsQiUnVLTPNmHHgV5chqhGXiAOOSQ=; b=ntQwLnConFPwc2mrdvrzf2M3U8bFgqKfipUaqVjz4bEGDecS2qLLFJ/es1JMADTgUw 3VmhTbXWMN0ckLQ80ZkB1ZgOwRWoYX1G+6ULXwQCHtW4I50yV4CmSAcUt0peNHj9XxcP k1SzCPyonkfgfCUYAw2UphACnbWP6/xJU3e7OQc+UBH6D+DKnT8EWt8LJyl6jUAhtSGR 58tkDPmyUVvMfhOR1/r7MCYdhSDc1D+7K5XfMPjkyo2XbOEdu391CqF3vUaQ3WE0BUbg RTZJG/o1JBBPF3JBExUTij8pGUr2WGIui7wdh6zdb2AAd2sic02snjTGQALX7wtTA6P6 A85A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ajb3VhMj; 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 y8si4370438plr.92.2019.01.15.14.54.45; Tue, 15 Jan 2019 14:55:01 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=Ajb3VhMj; 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 S2387596AbfAOQom (ORCPT + 99 others); Tue, 15 Jan 2019 11:44:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:34190 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728652AbfAOQoh (ORCPT ); Tue, 15 Jan 2019 11:44:37 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D02D12054F; Tue, 15 Jan 2019 16:44:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547570676; bh=Bb+8WDEzBkRhBsTzSoBYAuA1Kaq9Oc8smB+qB0NmMYQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ajb3VhMjyRJD3SJXyLAjRSee15yAbWjR7z4F60Wo8OAbVP1FGJE/6TRQcvyLdgMY9 jYWwMqBwkH5QWWpaw/Ec5pF6w4A6kHQcPbaF2DwJq6o7QI0rlm7gDEnHCQd3PmJTEy zuLIuhTSv+pb7iMBjtnGcRIda5wuqwXZnHRM3dI0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Con Kolivas , Saranya Gopal Subject: [PATCH 4.20 03/57] usbcore: Select only first configuration for non-UAC3 compliant devices Date: Tue, 15 Jan 2019 17:35:44 +0100 Message-Id: <20190115154910.910829923@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190115154910.734892368@linuxfoundation.org> References: <20190115154910.734892368@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ From: Saranya Gopal commit ff2a8c532c14fd22fb26a36574d9ff199afbbe54 upstream. In most of the UAC1 and UAC2 audio devices, the first configuration is most often the best configuration. However, with recent patch to support UAC3 configuration, second configuration was unintentionally chosen for some of the UAC1/2 devices that had more than one configuration. This was because of the existing check after the audio config check which selected any config which had a non-vendor class. This patch fixes this issue. Fixes: f13912d3f014 ("usbcore: Select UAC3 configuration for audio if present") Reported-by: Con Kolivas Signed-off-by: Saranya Gopal Tested-by: Con Kolivas Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/usb/core/generic.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) --- a/drivers/usb/core/generic.c +++ b/drivers/usb/core/generic.c @@ -143,9 +143,12 @@ int usb_choose_configuration(struct usb_ continue; } - if (i > 0 && desc && is_audio(desc) && is_uac3_config(desc)) { - best = c; - break; + if (i > 0 && desc && is_audio(desc)) { + if (is_uac3_config(desc)) { + best = c; + break; + } + continue; } /* From the remaining configs, choose the first one whose