milos-linux/sound/soc/fsl
Chancel Liu 4790af1cc2
ASoC: fsl_sai: Fix 32 slots TDM broken by integer shift UB in xMR write
When configuring 32 slots TDM (channels == slots == 32), the xMR
(Mask Register) write used:
~0UL - ((1 << min(channels, slots)) - 1)

The literal "1" is a signed 32-bit int. Shifting it by 32 positions is
undefined behaviour which may set this register to 0xFFFFFFFF, masking
all 32 slots.

Use GENMASK_U32() macro instead. For 32 slots this produces a zero mask:
~GENMASK_U32(31, 0) = ~0xFFFFFFFF = 0x00000000
Behaviour for fewer than 32 slots is unchanged.

Fixes: 770f58d7d2 ("ASoC: fsl_sai: Support multiple data channel enable bits")
Cc: stable@vger.kernel.org
Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://patch.msgid.link/20260601083327.1535185-1-chancel.liu@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-06-04 11:16:58 +01:00
..
efika-audio-fabric.c ASoC: Add SPDX ids to many soc files 2026-02-22 23:52:20 +00:00
eukrea-tlv320.c
fsl-asoc-card.c ASoC: fsl-asoc-card: Use of_property_present() for non-boolean properties 2025-12-17 12:01:03 +00:00
fsl_asrc.c ASoC: fsl_asrc: Add support for i.MX952 platform 2026-02-06 17:22:36 +00:00
fsl_asrc.h ASoC: fsl_asrc: Add support for i.MX952 platform 2026-02-06 17:22:36 +00:00
fsl_asrc_common.h ASoC: fsl_asrc_m2m: Add option to start ASRC before DMA device for M2M 2026-02-06 17:22:35 +00:00
fsl_asrc_dma.c ASoC: fsl: name back to pcm_new()/pcm_free() 2026-03-16 13:37:50 +00:00
fsl_asrc_m2m.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
fsl_aud2htx.c ASoC: fsl: Convert to RUNTIME_PM_OPS() and co 2025-03-17 10:14:39 +00:00
fsl_aud2htx.h ASoC: fsl_aud2htx: add IEC958_SUBFRAME_LE format in supported list 2025-10-21 15:10:55 +01:00
fsl_audmix.c ASoC: fsl_audmix: Add support for i.MX952 platform 2026-01-26 12:09:18 +00:00
fsl_audmix.h
fsl_dma.c ASoC: update outdated comments for removed snd_soc_new_pcms() 2026-03-24 19:52:27 +00:00
fsl_dma.h
fsl_easrc.c ASoC: fsl: fix mixer-test failures 2026-04-01 18:24:31 +01:00
fsl_easrc.h ASoC: fsl_easrc: define functions for memory to memory usage 2024-12-13 08:57:08 +00:00
fsl_esai.c ASoC: fsl: Convert to RUNTIME_PM_OPS() and co 2025-03-17 10:14:39 +00:00
fsl_esai.h
fsl_micfil.c ASoC: fsl_micfil: Fix event generation in micfil_quality_set() 2026-04-01 18:24:25 +01:00
fsl_micfil.h ASoC: fsl_micfil: Add decimation filter bypass mode support 2025-02-11 13:36:18 +00:00
fsl_mqs.c ASoC: fsl_mqs: rename system manager indices for i.MX95 2025-07-03 12:59:59 +01:00
fsl_qmc_audio.c ASoC: fsl: name back to pcm_new()/pcm_free() 2026-03-16 13:37:50 +00:00
fsl_rpmsg.c ASoC: fsl_rpmsg: Allocate a smaller buffer size for capture stream 2025-05-02 05:38:54 +09:00
fsl_rpmsg.h ASoC: fsl_rpmsg: Allocate a smaller buffer size for capture stream 2025-05-02 05:38:54 +09:00
fsl_sai.c ASoC: fsl_sai: Fix 32 slots TDM broken by integer shift UB in xMR write 2026-06-04 11:16:58 +01:00
fsl_sai.h ASoC: fsl_sai: add bitcount and timestamp controls 2026-03-10 13:55:58 +00:00
fsl_spdif.c ASoC: fsl_spdif: Constify some structures 2025-11-03 13:14:17 +00:00
fsl_spdif.h
fsl_ssi.c ASoC: fsl: fsl_ssi: Replace deprecated strcpy() with strscpy() 2025-12-14 19:37:28 +09:00
fsl_ssi.h
fsl_ssi_dbg.c
fsl_utils.c ASoC: fsl_utils: Add snd_kcontrol functions for specific cases 2026-03-10 13:55:57 +00:00
fsl_utils.h ASoC: fsl_utils: Add snd_kcontrol functions for specific cases 2026-03-10 13:55:57 +00:00
fsl_xcvr.c ASoC: fsl_xcvr: Fix event generation for cached controls 2026-05-04 22:21:24 +09:00
fsl_xcvr.h ASoC: fsl_xcvr: add bitcount and timestamp controls 2026-03-10 13:55:59 +00:00
imx-audio-rpmsg.c
imx-audmix.c ASoC: fsl: Rename stream name of SAI DAI driver 2025-02-24 18:35:53 +00:00
imx-audmux.c ASoC: fsl: Use kcalloc() instead of kzalloc() 2025-08-20 15:09:23 +01:00
imx-audmux.h
imx-card.c ASoC: fsl: imx-card: initialize playback_only and capture_only 2026-03-18 13:26:50 +00:00
imx-es8328.c
imx-hdmi.c ASoC: imx-hdmi: remove cpu_pdev related code 2025-08-24 22:41:09 +01:00
imx-pcm-dma.c
imx-pcm-fiq.c ASoC: fsl: name back to pcm_new()/pcm_free() 2026-03-16 13:37:50 +00:00
imx-pcm-rpmsg.c ASoC: fsl: name back to pcm_new()/pcm_free() 2026-03-16 13:37:50 +00:00
imx-pcm-rpmsg.h
imx-pcm.h
imx-rpmsg.c ASoC: imx-rpmsg: Add DSD format support with dynamic DAI format switching 2026-04-03 15:13:22 +01:00
imx-sgtl5000.c
imx-ssi.h
Kconfig ASoC: fsl_sai: add IMX_SCMI_MISC_DRV dependency 2026-02-02 12:09:36 +00:00
lpc3xxx-i2s.c
lpc3xxx-i2s.h
lpc3xxx-pcm.c
Makefile ASoC: fsl_asrc_m2m: Add memory to memory function 2024-12-13 08:57:09 +00:00
mpc5200_dma.c ASoC: fsl: mpc5200_dma: Convert to devm_ioremap() 2026-03-26 13:42:07 +00:00
mpc5200_dma.h
mpc5200_psc_ac97.c
mpc5200_psc_i2s.c
p1022_ds.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
p1022_rdk.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
pcm030-audio-fabric.c