]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: ops: Fix bounds check for _sx controls
authorMark Brown <broonie@kernel.org>
Wed, 11 May 2022 13:41:36 +0000 (14:41 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 12 May 2022 10:41:21 +0000 (11:41 +0100)
commita590e35dc5dfbbb7ffc4b79b3f99a427581c57db
tree53ec341920244209927d096bfc918ee949d529a4
parent1e79c222ad2b847213bda31240772d7f4b865b8b
ASoC: ops: Fix bounds check for _sx controls

For _sx controls the semantics of the max field is not the usual one, max
is the number of steps rather than the maximum value. This means that our
check in snd_soc_put_volsw_sx() needs to just check against the maximum
value.

Fixes: 15c4df6a2db87af6 ("ASoC: ops: Reject out of bounds values in snd_soc_put_volsw_sx()")
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20220511134137.169575-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-ops.c