diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2013-09-13 10:52:14 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-13 14:51:07 -0700 |
commit | a7abc25bd4142a45bbcd90281a1869850a922876 (patch) | |
tree | 24e179a90c4de71b7dff76068878733f459eb867 /sound | |
parent | 67a8bceeb8f58b365104b0b35285205bff488727 (diff) | |
download | kernel_samsung_smdk4412-a7abc25bd4142a45bbcd90281a1869850a922876.zip kernel_samsung_smdk4412-a7abc25bd4142a45bbcd90281a1869850a922876.tar.gz kernel_samsung_smdk4412-a7abc25bd4142a45bbcd90281a1869850a922876.tar.bz2 |
ASoC: max98095: a couple array underflows
commit f8d7b13e14357ed19d2ca2799539600418dc3939 upstream.
The ->put() function are called from snd_ctl_elem_write() with user
supplied data. The limit checks here could underflow leading to a
crash.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/max98095.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/codecs/max98095.c b/sound/soc/codecs/max98095.c index e1d282d..51bac5c 100644 --- a/sound/soc/codecs/max98095.c +++ b/sound/soc/codecs/max98095.c @@ -1865,7 +1865,7 @@ static int max98095_put_eq_enum(struct snd_kcontrol *kcontrol, struct max98095_pdata *pdata = max98095->pdata; int channel = max98095_get_eq_channel(kcontrol->id.name); struct max98095_cdata *cdata; - int sel = ucontrol->value.integer.value[0]; + unsigned int sel = ucontrol->value.integer.value[0]; struct max98095_eq_cfg *coef_set; int fs, best, best_val, i; int regmask, regsave; @@ -2011,7 +2011,7 @@ static int max98095_put_bq_enum(struct snd_kcontrol *kcontrol, struct max98095_pdata *pdata = max98095->pdata; int channel = max98095_get_bq_channel(kcontrol->id.name); struct max98095_cdata *cdata; - int sel = ucontrol->value.integer.value[0]; + unsigned int sel = ucontrol->value.integer.value[0]; struct max98095_biquad_cfg *coef_set; int fs, best, best_val, i; int regmask, regsave; |