Skip to content

Commit 26a1af3

Browse files
Colin Ian Kinggregkh
authored andcommitted
ALSA: ctxfi: cthw20k2: fix mask on conf to allow 4 bits
[ Upstream commit 26a9630 ] 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: 8cc7236 ("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>
1 parent 6827415 commit 26a1af3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sound/pci/ctxfi/cthw20k2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,7 @@ static int daio_mgr_dao_init(void *blk, unsigned int idx, unsigned int conf)
991991

992992
if (idx < 4) {
993993
/* S/PDIF output */
994-
switch ((conf & 0x7)) {
994+
switch ((conf & 0xf)) {
995995
case 1:
996996
set_field(&ctl->txctl[idx], ATXCTL_NUC, 0);
997997
break;

0 commit comments

Comments
 (0)