]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Aug 2025 10:08:40 +0000 (12:08 +0200)
commit4c39fc79ae2560c28cd1e73dd4a90170b0c7a78f
tree697ebd5c1350ed5f9979e358d1a3083b46c9a005
parentee1c30d7c6fc5b783e2f016c6206f777486448c4
ASoC: ops: dynamically allocate struct snd_ctl_elem_value

[ Upstream commit 7e10d7242ea8a5947878880b912ffa5806520705 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/soc-ops.c