mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-06 11:54:14 -04:00
ASoC: ops: Fix off by one in range control validation
[ Upstream commit 5871321fb4558c55bf9567052b618ff0be6b975e ] We currently report that range controls accept a range of 0..(max-min) but accept writes in the range 0..(max-min+1). Remove that extra +1. Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20220604105246.4055214-1-broonie@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
ede990cfc4
commit
f298d2e4c6
1 changed files with 2 additions and 2 deletions
|
|
@ -530,7 +530,7 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,
|
|||
return -EINVAL;
|
||||
if (mc->platform_max && tmp > mc->platform_max)
|
||||
return -EINVAL;
|
||||
if (tmp > mc->max - mc->min + 1)
|
||||
if (tmp > mc->max - mc->min)
|
||||
return -EINVAL;
|
||||
|
||||
if (invert)
|
||||
|
|
@ -551,7 +551,7 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,
|
|||
return -EINVAL;
|
||||
if (mc->platform_max && tmp > mc->platform_max)
|
||||
return -EINVAL;
|
||||
if (tmp > mc->max - mc->min + 1)
|
||||
if (tmp > mc->max - mc->min)
|
||||
return -EINVAL;
|
||||
|
||||
if (invert)
|
||||
|
|
|
|||
Loading…
Reference in a new issue