Revert "ASoC: ops: Fix the bounds checking in snd_soc_put_volsw_sx and snd_soc_put_xr_sx"
This is now properly fixed in1d2326b3a1. This reverts commit6d6a178f58. Change-Id: I12e26bc35c4d7e0f87ff024a7073638c915fec4a
This commit is contained in:
parent
1d2326b3a1
commit
51f779e15a
1 changed files with 2 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue