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:28:43 +0000 (11:28 +0100)
commit98b15c706644bebc19d2e77ccc360cc51444f6d0
tree1bc85c1532bc1487530d989b2b620686b5c28376
parentf88a6977f8b981bfb5fddd18fbaa75e57e8af293
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: 4f1e50d6a9cf9c1b ("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