]> 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)
commitfb13f93cdf723d3bfce18b8d4824af8f25979ff0
treecf0abaa44ee19fe6acb33441e840556db28b1169
parenta77efded41c2912f464e23a8e8ae04ba2490e36e
ASoC: ops: Fix bounds check for _sx controls

[ Upstream commit adef9e917c0deddbd11fbd84231979847217ec8e ]

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: 9fc4493fa4258907 ("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