]> 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Dec 2022 10:23:04 +0000 (11:23 +0100)
commit37174c544633fbeb9d81ac764e79c4b4c6dc95cb
treecf0abaa44ee19fe6acb33441e840556db28b1169
parentf4c2ff5ed51cc7803dc146877885c3808ad66795
ASoC: ops: Fix bounds check for _sx controls

[ Upstream commit 698813ba8c580efb356ace8dbf55f61dac6063a8 ]

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