summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2021-02-27 00:15:27 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-11 14:05:00 +0100
commit4a7cd6082e7c2935ad7f5f3c51d6dbb2a6a9a391 (patch)
tree82bc6526d1cec405867e9a9a4acd2c65ff0751af
parent1eee7382abc87d537c51d5c20d998112b24174db (diff)
downloadlinux-4a7cd6082e7c2935ad7f5f3c51d6dbb2a6a9a391.tar.gz
linux-4a7cd6082e7c2935ad7f5f3c51d6dbb2a6a9a391.tar.bz2
linux-4a7cd6082e7c2935ad7f5f3c51d6dbb2a6a9a391.zip
ALSA: ctxfi: cthw20k2: fix mask on conf to allow 4 bits
[ 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>
-rw-r--r--sound/pci/ctxfi/cthw20k2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/pci/ctxfi/cthw20k2.c b/sound/pci/ctxfi/cthw20k2.c
index 3c966fafc754..6c9ab602212e 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;