[PATCH] ASoC: topology: Guard against out-of-range mixer control shift
Mark Brown
broonie at kernel.org
Sat Jul 18 11:53:56 PDT 2026
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?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-mediatek/attachments/20260718/75e02d1e/attachment.sig>
More information about the Linux-mediatek
mailing list