linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <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 5.10 31/42] ALSA: ctxfi: cthw20k2: fix mask on conf to allow 4 bits
Date: Mon,  8 Mar 2021 13:30:57 +0100	[thread overview]
Message-ID: <20210308122719.652039636@linuxfoundation.org> (raw)
In-Reply-To: <20210308122718.120213856@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 fc1bc18caee9..85d1fc76f59e 100644
--- a/sound/pci/ctxfi/cthw20k2.c
+++ b/sound/pci/ctxfi/cthw20k2.c
@@ -991,7 +991,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-08 12:35 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-08 12:30 [PATCH 5.10 00/42] 5.10.22-rc1 review Greg Kroah-Hartman
2021-03-08 12:30 ` [PATCH 5.10 01/42] ALSA: hda/realtek: Enable headset mic of Acer SWIFT with ALC256 Greg Kroah-Hartman
2021-03-08 12:30 ` [PATCH 5.10 02/42] ALSA: usb-audio: use Corsair Virtuoso mapping for Corsair Virtuoso SE Greg Kroah-Hartman
2021-03-08 12:30 ` [PATCH 5.10 03/42] ALSA: usb-audio: Drop bogus dB range in too low level Greg Kroah-Hartman
2021-03-08 12:30 ` [PATCH 5.10 04/42] tpm, tpm_tis: Decorate tpm_tis_gen_interrupt() with request_locality() Greg Kroah-Hartman
2021-03-08 12:30 ` [PATCH 5.10 05/42] tpm, tpm_tis: Decorate tpm_get_timeouts() " Greg Kroah-Hartman
2021-03-08 12:30 ` [PATCH 5.10 06/42] btrfs: avoid double put of block group when emptying cluster Greg Kroah-Hartman
2021-03-08 12:30 ` [PATCH 5.10 07/42] btrfs: fix raid6 qstripe kmap Greg Kroah-Hartman
2021-03-08 12:30 ` [PATCH 5.10 08/42] btrfs: fix race between writes to swap files and scrub Greg Kroah-Hartman
2021-03-08 12:30 ` [PATCH 5.10 09/42] btrfs: fix race between swap file activation and snapshot creation Greg Kroah-Hartman
2021-03-08 12:30 ` [PATCH 5.10 10/42] btrfs: fix stale data exposure after cloning a hole with NO_HOLES enabled Greg Kroah-Hartman
2021-03-08 12:30 ` [PATCH 5.10 11/42] btrfs: fix race between extent freeing/allocation when using bitmaps Greg Kroah-Hartman
2021-03-08 12:30 ` [PATCH 5.10 12/42] btrfs: validate qgroup inherit for SNAP_CREATE_V2 ioctl Greg Kroah-Hartman
2021-03-08 12:30 ` [PATCH 5.10 13/42] btrfs: free correct amount of space in btrfs_delayed_inode_reserve_metadata Greg Kroah-Hartman
2021-03-08 12:30 ` [PATCH 5.10 14/42] btrfs: unlock extents in btrfs_zero_range in case of quota reservation errors Greg Kroah-Hartman
2021-03-08 12:30 ` [PATCH 5.10 15/42] btrfs: fix warning when creating a directory with smack enabled Greg Kroah-Hartman
2021-03-08 12:30 ` [PATCH 5.10 16/42] PM: runtime: Update device status before letting suppliers suspend Greg Kroah-Hartman
2021-03-08 12:30 ` [PATCH 5.10 17/42] ring-buffer: Force before_stamp and write_stamp to be different on discard Greg Kroah-Hartman
2021-03-08 12:30 ` [PATCH 5.10 18/42] io_uring: ignore double poll add on the same waitqueue head Greg Kroah-Hartman
2021-03-08 12:30 ` [PATCH 5.10 19/42] dm bufio: subtract the number of initial sectors in dm_bufio_get_device_size Greg Kroah-Hartman
2021-03-08 12:30 ` [PATCH 5.10 20/42] dm verity: fix FEC for RS roots unaligned to block size Greg Kroah-Hartman
2021-03-08 12:30 ` [PATCH 5.10 21/42] drm/amdgpu:disable VCN for Navi12 SKU Greg Kroah-Hartman
2021-03-08 12:30 ` [PATCH 5.10 22/42] drm/amdgpu: fix parameter error of RREG32_PCIE() in amdgpu_regs_pcie Greg Kroah-Hartman
2021-03-08 12:30 ` [PATCH 5.10 23/42] crypto - shash: reduce minimum alignment of shash_desc structure Greg Kroah-Hartman
2021-03-08 12:30 ` [PATCH 5.10 24/42] arm64: mm: Move reserve_crashkernel() into mem_init() Greg Kroah-Hartman
2021-03-08 12:30 ` [PATCH 5.10 25/42] arm64: mm: Move zone_dma_bits initialization into zone_sizes_init() Greg Kroah-Hartman
2021-03-08 12:30 ` [PATCH 5.10 26/42] of/address: Introduce of_dma_get_max_cpu_address() Greg Kroah-Hartman
2021-03-08 12:30 ` [PATCH 5.10 27/42] of: unittest: Add test for of_dma_get_max_cpu_address() Greg Kroah-Hartman
2021-03-08 12:30 ` [PATCH 5.10 28/42] arm64: mm: Set ZONE_DMA size based on devicetrees dma-ranges Greg Kroah-Hartman
2021-03-08 12:30 ` [PATCH 5.10 29/42] arm64: mm: Set ZONE_DMA size based on early IORT scan Greg Kroah-Hartman
2021-03-08 12:30 ` [PATCH 5.10 30/42] mm: Remove examples from enum zone_type comment Greg Kroah-Hartman
2021-03-08 12:30 ` Greg Kroah-Hartman [this message]
2021-03-08 12:30 ` [PATCH 5.10 32/42] RDMA/cm: Fix IRQ restore in ib_send_cm_sidr_rep Greg Kroah-Hartman
2021-03-08 12:30 ` [PATCH 5.10 33/42] RDMA/rxe: Fix missing kconfig dependency on CRYPTO Greg Kroah-Hartman
2021-03-08 12:31 ` [PATCH 5.10 34/42] IB/mlx5: Add missing error code Greg Kroah-Hartman
2021-03-08 12:31 ` [PATCH 5.10 35/42] ALSA: hda: intel-nhlt: verify config type Greg Kroah-Hartman
2021-03-08 12:31 ` [PATCH 5.10 36/42] ftrace: Have recordmcount use w8 to read relp->r_info in arm64_is_fake_mcount Greg Kroah-Hartman
2021-03-08 12:31 ` [PATCH 5.10 37/42] rsxx: Return -EFAULT if copy_to_user() fails Greg Kroah-Hartman
2021-03-08 12:31 ` [PATCH 5.10 38/42] iommu/vt-d: Fix status code for Allocate/Free PASID command Greg Kroah-Hartman
2021-03-08 12:31 ` [PATCH 5.10 39/42] Revert "arm64: dts: amlogic: add missing ethernet reset ID" Greg Kroah-Hartman
2021-03-08 12:31 ` [PATCH 5.10 40/42] of: unittest: Fix build on architectures without CONFIG_OF_ADDRESS Greg Kroah-Hartman
2021-03-08 12:31 ` [PATCH 5.10 41/42] tomoyo: recognize kernel threads correctly Greg Kroah-Hartman
2021-03-08 12:31 ` [PATCH 5.10 42/42] r8169: fix resuming from suspend on RTL8105e if machine runs on battery Greg Kroah-Hartman
2021-03-08 17:50 ` [PATCH 5.10 00/42] 5.10.22-rc1 review Florian Fainelli
2021-03-08 20:35 ` Pavel Machek
2021-03-08 22:29 ` Guenter Roeck
2021-03-09  1:08 ` Samuel Zou
2021-03-09 10:27   ` Greg Kroah-Hartman
2021-03-09 10:27   ` Greg Kroah-Hartman
2021-03-09  4:43 ` 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=20210308122719.652039636@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).