ASoC: ops: dynamically allocate struct snd_ctl_elem_value
authorArnd Bergmann <arnd@arndb.de>
Tue, 10 Jun 2025 09:30:53 +0000 (11:30 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 10 Jun 2025 11:46:33 +0000 (12:46 +0100)
commit7e10d7242ea8a5947878880b912ffa5806520705
treed49e42d1c4790dfbca9368fb7d7d1d76fe477f47
parent2ccb77082853f6f034e2388228a3767049dab9cb
ASoC: ops: dynamically allocate struct snd_ctl_elem_value

This structure is really too larget to be allocated on the stack:

sound/soc/soc-ops.c:435:5: error: stack frame size (1296) exceeds limit (1280) in 'snd_soc_limit_volume' [-Werror,-Wframe-larger-than]

Change the function to dynamically allocate it instead.

There is probably a better way to do it since only two integer fields
inside of that structure are actually used, but this is the simplest
rework for the moment.

Fixes: 783db6851c18 ("ASoC: ops: Enforce platform maximum on initial value")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20250610093057.2643233-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-ops.c