ALSA: ctxfi: cthw20k2: fix mask on conf to allow 4 bits
authorColin Ian King <colin.king@canonical.com>
Sat, 27 Feb 2021 00:15:27 +0000 (00:15 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Mar 2021 12:46:35 +0000 (13:46 +0100)
commit0b4a2c28c3432eba93c658d7507bf21dbfe188b8
tree827a11a7eb15fee779145152c8cd88d41f65ad2e
parentad83307d1e625704cbf8e88de2c66dc8b175899e
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>
sound/pci/ctxfi/cthw20k2.c