Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp244015pxf; Wed, 10 Mar 2021 05:31:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJwEgPVr40zzJfa/HS0Qm9961v58AD+fOXHBrAnNxLvF/pQ0BDYiPIVJu3svozWkXKi2vwL9 X-Received: by 2002:a17:906:5d06:: with SMTP id g6mr3727286ejt.216.1615383102134; Wed, 10 Mar 2021 05:31:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615383102; cv=none; d=google.com; s=arc-20160816; b=WaeBECb3mzik8Ua4pYbwK+laqWfNl2d30a5oTPNJEp/+qL9diJup5m70UMlZ10cjhy fITpaK/Ow0ti1rLos2qekbqUZYuAoAWHnpFtsoF/1tWdep5j0AEzas1BlBiakpWSsE7D 2xc62k0pNPFlX9yXr+fpUVZ30iUCY4KNCQe74/qP9caE8XRerJ4rhSJP8mnMgaIO8Pof C6wW0rvHnPRHZqJw98ytEK7208DQ9AWTe7tFcbHjpjEUhZ5adIlGiZknEOhh18yuw0hX YvQ9SQcVfFopt2F2k9Ul6QJmE0LWV+8j13YTHBs3Z85Pur1nSFT23Wh4qzRJdVGA18MJ InwQ== 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=y5n4wXZ7F5juF40Mvt1Nk/ehnIIfX24l1sGIZGdzJwY=; b=GxGvlP+cCy+LyUGt5SZKEES1m+14+SUbUpB3XYncQFze34qURjcR2TAfSXV7TZgbB+ PWjwmCyN5DeANE6QK+htugcBE8U1erK1L4tz14QqqzVjM8zmVXbik596XLnYXDqMxGgj GpHlKtO5Lzl+J4pMjfqIX3jio+AvV9lqiZkptJVNLkOqE37z30lLJ1bP8Rp1WN2fNYhF Xe7wRTV8mK2aPVIG/ZK4nNiRegbQg+XDdhzZZDli8K1rbYTSsFr/KZuzuBQMLMHZvpY2 Uz04UGjDQ6JKNH6RIVVlX+mvof1H/vEkqkYqsPi0RlpiISXOI3PixY2OlCZClphMX/3v krsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=N21sne60; 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 t23si11952784ejf.231.2021.03.10.05.31.18; Wed, 10 Mar 2021 05:31:42 -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=N21sne60; 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 S234194AbhCJN2V (ORCPT + 99 others); Wed, 10 Mar 2021 08:28:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:46850 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233247AbhCJNZK (ORCPT ); Wed, 10 Mar 2021 08:25:10 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3D53565000; Wed, 10 Mar 2021 13:25:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615382710; bh=Sitk5O06wbe4ErJId/fGnv2hWDeEWRVRPatq40GoUTo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N21sne605QFFq9fldfuLpCG0QZId/dybuXZu8U6zQ04LvEKbBnOIVkudhr+YkdjdQ aZQS0kYKMSSO9J9iQpHgizWbWhtjoOOCDuinImfojdjm2dDQo5WonFi8KCxrBEq0H8 inE1m6yVnAgrLrYrGuNmZ0OPpaXJteiaYXHKhLTs= 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.14 05/20] ALSA: ctxfi: cthw20k2: fix mask on conf to allow 4 bits Date: Wed, 10 Mar 2021 14:24:42 +0100 Message-Id: <20210310132320.685630855@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210310132320.512307035@linuxfoundation.org> References: <20210310132320.512307035@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 b866d6b2c923..e603db4d5ef3 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