diff options
-rw-r--r-- | sound/soc/codecs/ab8500-codec.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sound/soc/codecs/ab8500-codec.c b/sound/soc/codecs/ab8500-codec.c index b8ba0adacfce..80555d7551e6 100644 --- a/sound/soc/codecs/ab8500-codec.c +++ b/sound/soc/codecs/ab8500-codec.c | |||
@@ -1225,13 +1225,18 @@ static int anc_status_control_put(struct snd_kcontrol *kcontrol, | |||
1225 | struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(codec->dev); | 1225 | struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(codec->dev); |
1226 | struct device *dev = codec->dev; | 1226 | struct device *dev = codec->dev; |
1227 | bool apply_fir, apply_iir; | 1227 | bool apply_fir, apply_iir; |
1228 | int req, status; | 1228 | unsigned int req; |
1229 | int status; | ||
1229 | 1230 | ||
1230 | dev_dbg(dev, "%s: Enter.\n", __func__); | 1231 | dev_dbg(dev, "%s: Enter.\n", __func__); |
1231 | 1232 | ||
1232 | mutex_lock(&drvdata->anc_lock); | 1233 | mutex_lock(&drvdata->anc_lock); |
1233 | 1234 | ||
1234 | req = ucontrol->value.integer.value[0]; | 1235 | req = ucontrol->value.integer.value[0]; |
1236 | if (req >= ARRAY_SIZE(enum_anc_state)) { | ||
1237 | status = -EINVAL; | ||
1238 | goto cleanup; | ||
1239 | } | ||
1235 | if (req != ANC_APPLY_FIR_IIR && req != ANC_APPLY_FIR && | 1240 | if (req != ANC_APPLY_FIR_IIR && req != ANC_APPLY_FIR && |
1236 | req != ANC_APPLY_IIR) { | 1241 | req != ANC_APPLY_IIR) { |
1237 | dev_err(dev, "%s: ERROR: Unsupported status to set '%s'!\n", | 1242 | dev_err(dev, "%s: ERROR: Unsupported status to set '%s'!\n", |