Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp245414pxf; Wed, 10 Mar 2021 05:33:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJzxZyCsDw0ACsCYQfb9zxEfnfawMK9q+9pqvKy+rz4pUZ/5sAngsrEq4688d5Qt3ZP2LW3T X-Received: by 2002:a17:906:774d:: with SMTP id o13mr3636045ejn.70.1615383223051; Wed, 10 Mar 2021 05:33:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615383223; cv=none; d=google.com; s=arc-20160816; b=Sw248bXEJNZfO5m1YzXc9cB+1B0JDqVgDX4fznp8vuQSP6zGNshBtD7XCuJJGVzTP1 txgQB/Oav6wlpJFIhcwSBSXFhLQ396naj+1bLXJAdJowDWlWdWmWvL5uLxPEM7sC9cdY WkOI1634b9Sv1TSKjkdVm71GxQWq/q6YXk/eaDsbkx9lP3RPjzfl31oLwInQETjTzhdb hOvWX1bNKfKgKGKLmlCEyNjcYkAWD1f59ywPG7lTB2455G1+Axt/FGb/S2Heb4uLkdtx yNs8CBLDCUF9tsFhmzySpllnfYaXT2Lv4l1avDfw7y9w3RnMUszZnQ3EoO1hmlNgQkIg q2VA== 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=V9V3JlcLKttyQkxuqQYofHUIWIXLQVPBcO9v3x6V6Wk=; b=dwtcd6rzkZvPbSiTQ78MfIyfT8TvpHwR1lDy+V6Dzek6ozNNlAyikrHlCxhw1b1u6i iYKWlcRMkpBrg2l1ElmktL0Hzi6nIH/QGMtSH8iQJ/Xqk9ri0QFKP2oNf6xJHr/e4jPY fJSJL4SxtfEMaiKNT+7iaLlSgvU2OCtcLQnonxCmOGbPTaRNgbWRPGy29/KahH38aAqR XxJ1tyc9RtYb03tn9Ax2r+Jk2n7q8dZB5CYd80pfyLb1otLrQ99XYBF9MyLbJu49kpkQ cpr/U77kHcc8J/8BIjX4ssMiXAIbNitPc8tr9xhtaJEE/o1EBb+syL8EqbtUOquHzPZz 5Dfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YrL5oyW1; 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 l17si11326955eda.91.2021.03.10.05.33.20; Wed, 10 Mar 2021 05:33:43 -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=YrL5oyW1; 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 S234418AbhCJNaW (ORCPT + 99 others); Wed, 10 Mar 2021 08:30:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:47046 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233411AbhCJNZf (ORCPT ); Wed, 10 Mar 2021 08:25:35 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2203365002; Wed, 10 Mar 2021 13:25:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615382730; bh=HbVLD23iXTfOOlR9CYvrHBWtenET253C2W5Xy3eGDrg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YrL5oyW1sKUkrhVzgLACVUfn2f7tHGyQ6/E+hSybOLtpcJwzW9YPgAx9BJQC+Kn2A nDbWAspmBmxf4Yv1yzrXJJA/ET/TDO50QELjdnQmSMV4/B9mrkeky3dxVx7R8YJLkC fRFiKB6gELtTF+rnsqjCvYs2nejZnNWNqxkF6Ow8= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Takashi Iwai , Sasha Levin Subject: [PATCH 4.4 3/7] ALSA: ctxfi: cthw20k2: fix mask on conf to allow 4 bits Date: Wed, 10 Mar 2021 14:25:16 +0100 Message-Id: <20210310132319.269031257@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210310132319.155338551@linuxfoundation.org> References: <20210310132319.155338551@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: Greg Kroah-Hartman 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 d86678c2a957..5beb4a3d203b 100644 --- a/sound/pci/ctxfi/cthw20k2.c +++ b/sound/pci/ctxfi/cthw20k2.c @@ -995,7 +995,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