]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: ops: Shift tested values in snd_soc_put_volsw() by +min
authorMarek Vasut <marex@denx.de>
Tue, 15 Feb 2022 13:06:45 +0000 (14:06 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 16 Feb 2022 16:33:48 +0000 (16:33 +0000)
commit78ac324ff08385349efd58e4323cac03930112df
tree68efc5aabf5a4e17fbd9920da17d68fb0c480e51
parent8832eb73580c20e696b85f2041bc1d8c2a7cda53
ASoC: ops: Shift tested values in snd_soc_put_volsw() by +min

While the $val/$val2 values passed in from userspace are always >= 0
integers, the limits of the control can be signed integers and the $min
can be non-zero and less than zero. To correctly validate $val/$val2
against platform_max, add the $min offset to val first.

Fixes: 722f62d21c04c ("ASoC: ops: Reject out of bounds values in snd_soc_put_volsw()")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20220215130645.164025-1-marex@denx.de
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-ops.c