]> git.itanic.dy.fi Git - linux-stable/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Mar 2022 18:04:07 +0000 (19:04 +0100)
commit0b2ecc9163472128e7f30b517bee92dcd27ffc34
tree329a81a4c8f877c5c6d4454288d44392bd3b9da3
parent97968b4689f2cd5a97082ed0c37e0ead75c0cfb5
ASoC: ops: Shift tested values in snd_soc_put_volsw() by +min

commit 9bdd10d57a8807dba0003af0325191f3cec0f11c upstream.

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: 817f7c9335ec0 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/soc/soc-ops.c