Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1709285pxb; Mon, 8 Mar 2021 04:36:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJxrDa26ial+uwkM/e7M5HOjMLzyYWMLl+9NMQiUGu5dzUMGIu+RXjmCKcz0y4/QFpo0VosX X-Received: by 2002:a50:e80c:: with SMTP id e12mr22027683edn.229.1615206991710; Mon, 08 Mar 2021 04:36:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615206991; cv=none; d=google.com; s=arc-20160816; b=C9ORzIaIPwaea9iKPzZtvTAoOBpfvOkQ0NmbhFx9xfD3XrQTsvRFPXNRfzytjHls+R d+a9EJBvvOPuUcQfRaJckT+JO3/frmgDbBrOwYDfuR8znpRWTVnyo5ImQ9/ZjS7r1S0B ByZ/MJTLth1ThdLSCDpmAsHX97Fi0U1nzpxN2z/0nDhR+My4XXQYUnl001bjhM56u97x VbDdHoKxxrudc+fF+65ZDVQTxgNiK57iEheoFkFYgZwrJaO4hA110c8uToAXaYDL4O8n CxDmiMmsmb725dLUefIN05KxIC332eNjNYGxTrsHTP5rYYpLFfT4r94pFsF/ctlNqkmL OShQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bil5juoBwNhZFkQY2brgL4Z1uHiyYQDiTLIfMf2zLuw=; b=Dy6+uLA+d0hcubueWuGYEki/sGxD7Fjd+bYR/a7yqOvfnld47nEULbySfErrjcaDJA zcpksC8hXqa9MPrYBYiJOrGPhD6gEqlerbjZUIyL6X+iocjhNh6cxmtH9jFQ+JXZJ1Hf kVw5FZckdedVILJKfyf4f68/kD+iNCrDRmzPscjzijh5P9/JK4I53Nt7GaxCP5O33lsX 1iASC63iLn5czvMRHW5bmzb/KHgsvHbY7qYkHuO0diuoe86wKqwm6PdDasg34nwYeezo b2yVjtTsQciufpc7h+J04zSQm0wLxL2E0IBH+pw6uWUL24qODZbYAaZUIrQaP8Kykqbo Zpww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LtLGVsaQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g20si6989649edq.32.2021.03.08.04.36.09; Mon, 08 Mar 2021 04:36:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LtLGVsaQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231890AbhCHMe6 (ORCPT + 99 others); Mon, 8 Mar 2021 07:34:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:43284 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230510AbhCHMeT (ORCPT ); Mon, 8 Mar 2021 07:34:19 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id BA89865203; Mon, 8 Mar 2021 12:34:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615206859; bh=QtfgpEbjnnt/6dA/dFPtbmehdAcvax97J26PQe0phFM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LtLGVsaQAgHWglPYw51f2WV1BKtTbRMdmSl26zz+ZyATuCwj6wK2U8oonRdOENkfP na6m2J5PhKS+7idnFBy1LnvI1mRgkY1MOxSQMVEczE2cX5cI6luPypEVuiMhcuHiVO cqH1OGj2DfXVW2k8r3XQtqdZuCODx5Sz/aiNE6fM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Takashi Iwai , Sasha Levin Subject: [PATCH 5.10 31/42] ALSA: ctxfi: cthw20k2: fix mask on conf to allow 4 bits Date: Mon, 8 Mar 2021 13:30:57 +0100 Message-Id: <20210308122719.652039636@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210308122718.120213856@linuxfoundation.org> References: <20210308122718.120213856@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King [ Upstream commit 26a9630c72ebac7c564db305a6aee54a8edde70e ] Currently the mask operation on variable conf is just 3 bits so the switch statement case value of 8 is unreachable dead code. The function daio_mgr_dao_init can be passed a 4 bit value, function dao_rsc_init calls it with conf set to: conf = (desc->msr & 0x7) | (desc->passthru << 3); so clearly when desc->passthru is set to 1 then conf can be at least 8. Fix this by changing the mask to 0xf. Fixes: 8cc72361481f ("ALSA: SB X-Fi driver merge") Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210227001527.1077484-1-colin.king@canonical.com Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/pci/ctxfi/cthw20k2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/ctxfi/cthw20k2.c b/sound/pci/ctxfi/cthw20k2.c index fc1bc18caee9..85d1fc76f59e 100644 --- a/sound/pci/ctxfi/cthw20k2.c +++ b/sound/pci/ctxfi/cthw20k2.c @@ -991,7 +991,7 @@ static int daio_mgr_dao_init(void *blk, unsigned int idx, unsigned int conf) if (idx < 4) { /* S/PDIF output */ - switch ((conf & 0x7)) { + switch ((conf & 0xf)) { case 1: set_field(&ctl->txctl[idx], ATXCTL_NUC, 0); break; -- 2.30.1