Merge "ASoC: error check for backend index and MCLK src"

This commit is contained in:
qctecmdr 2020-10-25 07:34:22 -07:00 • committed by Gerrit - the friendly Code Review server
commit 6b3783e3b8

View file

@ -31245,12 +31245,12 @@ static int msm_routing_put_mclk_src_cfg(struct snd_kcontrol *kcontrol,
mclk_src_id = ucontrol->value.integer.value[1];
mclk_freq = ucontrol->value.integer.value[2];
if (be_idx < 0 && be_idx >= MSM_BACKEND_DAI_MAX) {
if (be_idx < 0 || be_idx >= MSM_BACKEND_DAI_MAX) {
pr_err("%s: Invalid be id %d\n", __func__, be_idx);
return -EINVAL;
}
if (mclk_src_id < MCLK_SRC_INT && mclk_src_id >= MCLK_SRC_MAX) {
if (mclk_src_id < MCLK_SRC_INT || mclk_src_id >= MCLK_SRC_MAX) {
pr_err("%s: Invalid MCLK src %d\n", __func__, mclk_src_id);
return -EINVAL;
}