linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: gregkh@linuxfoundation.org
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Colin Ian King <colin.king@canonical.com>,
	Takashi Iwai <tiwai@suse.de>, Sasha Levin <sashal@kernel.org>
Subject: [PATCH 4.9 04/11] ALSA: ctxfi: cthw20k2: fix mask on conf to allow 4 bits
Date: Wed, 10 Mar 2021 14:25:03 +0100	[thread overview]
Message-ID: <20210310132320.530249068@linuxfoundation.org> (raw)
In-Reply-To: <20210310132320.393957501@linuxfoundation.org>

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

From: Colin Ian King <colin.king@canonical.com>

[ 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 <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210227001527.1077484-1-colin.king@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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 18ee7768b7c4..ae8aa10a4a5d 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




  parent reply	other threads:[~2021-03-10 13:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10 13:24 [PATCH 4.9 00/11] 4.9.261-rc1 review gregkh
2021-03-10 13:25 ` [PATCH 4.9 01/11] btrfs: raid56: simplify tracking of Q stripe presence gregkh
2021-03-10 13:25 ` [PATCH 4.9 02/11] btrfs: fix raid6 qstripe kmap gregkh
2021-03-10 13:25 ` [PATCH 4.9 03/11] usbip: tools: fix build error for multiple definition gregkh
2021-03-10 13:25 ` gregkh [this message]
2021-03-10 13:25 ` [PATCH 4.9 05/11] rsxx: Return -EFAULT if copy_to_user() fails gregkh
2021-03-10 13:25 ` [PATCH 4.9 06/11] dm table: fix iterate_devices based device capability checks gregkh
2021-03-10 13:25 ` [PATCH 4.9 07/11] dm table: fix DAX " gregkh
2021-03-10 13:25 ` [PATCH 4.9 08/11] iommu/amd: Fix sleeping in atomic in increase_address_space() gregkh
2021-03-10 13:25 ` [PATCH 4.9 09/11] platform/x86: acer-wmi: Add new force_caps module parameter gregkh
2021-03-10 13:25 ` [PATCH 4.9 10/11] PCI: Add function 1 DMA alias quirk for Marvell 9215 SATA controller gregkh
2021-03-10 13:25 ` [PATCH 4.9 11/11] misc: eeprom_93xx46: Add quirk to support Microchip 93LC46B eeprom gregkh
2021-03-10 22:00 ` [PATCH 4.9 00/11] 4.9.261-rc1 review Shuah Khan
2021-03-10 23:50 ` Guenter Roeck
2021-03-11  4:27 ` Florian Fainelli
2021-03-11  8:35 ` Naresh Kamboju

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210310132320.530249068@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=colin.king@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).