Revert "ASoC: ops: Fix the bounds checking in snd_soc_put_volsw_sx and snd_soc_put_xr_sx"

This is now properly fixed in 1d2326b3a1.

This reverts commit 6d6a178f58.

Change-Id: I12e26bc35c4d7e0f87ff024a7073638c915fec4a
This commit is contained in:
Michael Bestas 2023-05-20 17:48:36 +03:00
commit 51f779e15a
No known key found for this signature in database
GPG key ID: CC95044519BE6669

View file

@ -449,7 +449,7 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol,
unsigned int val, val_mask, val2 = 0;
val = ucontrol->value.integer.value[0];
if (mc->platform_max && ((int)val + min) > mc->platform_max)
if (mc->platform_max && val > mc->platform_max)
return -EINVAL;
if (val > max)
return -EINVAL;
@ -946,12 +946,11 @@ int snd_soc_put_xr_sx(struct snd_kcontrol *kcontrol,
unsigned int invert = mc->invert;
unsigned long mask = (1UL<<mc->nbits)-1;
long max = mc->max;
long min = mc->min;
long val = ucontrol->value.integer.value[0];
unsigned int i, regval, regmask;
int err;
if (val < mc->min || ((int)val + min) > mc->max)
if (val < mc->min || val > mc->max)
return -EINVAL;
if (invert)
val = max - val;