diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c index 515d4a876ff3..4da6f66ea3a2 100644 --- a/sound/soc/soc-ops.c +++ b/sound/soc/soc-ops.c @@ -915,6 +915,8 @@ int snd_soc_put_xr_sx(struct snd_kcontrol *kcontrol, unsigned int i, regval, regmask; int err; + if (val < mc->min || val > mc->max) + return -EINVAL; if (invert) val = max - val; val &= mask;