From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4BD58C4740C for ; Sun, 22 Sep 2019 18:54:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1C3BC21D6C for ; Sun, 22 Sep 2019 18:54:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569178494; bh=QxwfXe+/+15AzX8GC/b3QQmGn58a1gt4LpsnXXULnUs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=0cyGlxdXapqcWm4w3I9+U8pInaSZFc5uCOWqS47wjb6a5JGmVfK74QbHCAwVE5psa DX1fbzHEZhUy/Ag8QDhg4F5G9fWzjVxay3AhHM1kI77K6/G/FfigVDgqZgGyhKHy7D bJOxPjgDto4VW++ed5PbZu6M4FvLtlRPV9Er4K0U= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2408046AbfIVSyx (ORCPT ); Sun, 22 Sep 2019 14:54:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:55642 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2408044AbfIVSyw (ORCPT ); Sun, 22 Sep 2019 14:54:52 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5DD9721479; Sun, 22 Sep 2019 18:54:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569178491; bh=QxwfXe+/+15AzX8GC/b3QQmGn58a1gt4LpsnXXULnUs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0RDdP75GNWllWTsHCJdV7TslvwHWKQ7tlHyWR4vBuEcDJSvegNehXXBBh2j2pkxQh rrNM6PmQL7JithIAjhoeXX/+DDKYmTgAwAve5CLeUUub4MduBxPCcnYz0Ohxw/01Nz EA4veQt3gai7wyaLWBMQIYOnUfwm7ehvCdQWdh7M= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ard van Breemen , Takashi Iwai , Sasha Levin Subject: [PATCH AUTOSEL 4.19 026/128] ALSA: usb-audio: Skip bSynchAddress endpoint check if it is invalid Date: Sun, 22 Sep 2019 14:52:36 -0400 Message-Id: <20190922185418.2158-26-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190922185418.2158-1-sashal@kernel.org> References: <20190922185418.2158-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Ard van Breemen [ Upstream commit 1b34121d9f26d272b0b2334209af6b6fc82d4bf1 ] The Linux kernel assumes that get_endpoint(alts,0) and get_endpoint(alts,1) are eachothers feedback endpoints. To reassure that validity it will test bsynchaddress to comply with that assumption. But if the bsyncaddress is 0 (invalid), it will flag that as a wrong assumption and return an error. Fix: Skip the test if bSynchAddress is 0. Note: those with a valid bSynchAddress should have a code quirck added. Signed-off-by: Ard van Breemen Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/usb/pcm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c index 35c57a4204a8a..13ea63c959d39 100644 --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c @@ -464,6 +464,7 @@ static int set_sync_endpoint(struct snd_usb_substream *subs, } ep = get_endpoint(alts, 1)->bEndpointAddress; if (get_endpoint(alts, 0)->bLength >= USB_DT_ENDPOINT_AUDIO_SIZE && + get_endpoint(alts, 0)->bSynchAddress != 0 && ((is_playback && ep != (unsigned int)(get_endpoint(alts, 0)->bSynchAddress | USB_DIR_IN)) || (!is_playback && ep != (unsigned int)(get_endpoint(alts, 0)->bSynchAddress & ~USB_DIR_IN)))) { dev_err(&dev->dev, -- 2.20.1