aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/ab8500-codec.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2013-09-13 03:53:36 -0400
committerMark Brown <broonie@linaro.org>2013-09-13 13:35:55 -0400
commitd63733aed90b432e5cc489ddfa28e342f91b4652 (patch)
tree1496073ae8fc3393a68fe0abc51329ad42a81a1c /sound/soc/codecs/ab8500-codec.c
parent5df498a27ab385294fdb7cad19c623d4da94a780 (diff)
ASoC: ab8500-codec: info leak in anc_status_control_put()
If the user passes an invalid value it leads to an info leak when we print the error message or it could oops. This is called with user supplied data from snd_ctl_elem_write(). Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org
Diffstat (limited to 'sound/soc/codecs/ab8500-codec.c')
-rw-r--r--sound/soc/codecs/ab8500-codec.c7
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",