Re: [PATCH] ASoC: topology: Guard against out-of-range mixer control shift
From: Mark Brown
Date: Sat Jul 18 2026 - 14:54:11 EST
On Sat, Jul 18, 2026 at 06:34:42PM +0100, Daniel Golle wrote:
> soc_tplg_control_dmixer_create() copies the per-channel "shift" field from
> the topology file verbatim into struct soc_mixer_control. That value is
> later used as a shift amount in soc_get_volsw() / soc_put_volsw() (e.g.
> sm->shift = tplg_chan_get_shift(tplg, mc->channel, SNDRV_CHMAP_FL);
> sm->rshift = tplg_chan_get_shift(tplg, mc->channel, SNDRV_CHMAP_FR);
>
> + if (sm->shift >= 32 || sm->rshift >= 32) {
Won't this break for mono controls - the right shift lookup will return
a negative error code?
Attachment:
signature.asc
Description: PGP signature