diff --git a/asoc/msm-pcm-routing-v2.c b/asoc/msm-pcm-routing-v2.c index e3b5ae16d65a..32267d108431 100644 --- a/asoc/msm-pcm-routing-v2.c +++ b/asoc/msm-pcm-routing-v2.c @@ -1426,7 +1426,7 @@ int msm_pcm_routing_set_stream_ec_ref_chmix_cfg( pr_debug("%s: ch[%d][%d] weight = %d", __func__, i, j, cfg_data->channel_weight[i][j]); - if (fedai_id < 0 || fedai_id > MSM_FRONTEND_DAI_MAX) { + if (fedai_id < 0 || fedai_id >= MSM_FRONTEND_DAI_MAX) { pr_err("%s: Received out of bounds fedai_id %d\n", __func__, fedai_id); ret = -EINVAL; diff --git a/dsp/q6asm.c b/dsp/q6asm.c index 0174d598046d..7e7745b9cf07 100644 --- a/dsp/q6asm.c +++ b/dsp/q6asm.c @@ -3546,7 +3546,7 @@ static int q6asm_open_read_version_adaptor(struct audio_client *ac, int q6asm_open_read_with_retry(struct audio_client *ac, uint32_t format, uint16_t bits_per_sample, bool ts_mode) { - int i, rc; + int i = 0, rc = 0; mutex_lock(&session_lock); for (i = 0; i < ASM_ACTIVE_STREAMS_ALLOWED; i++) { @@ -3921,7 +3921,7 @@ static int q6asm_open_write_version_adaptor(struct audio_client *ac, int q6asm_open_write_with_retry(struct audio_client *ac, uint32_t format, uint16_t bits_per_sample) { - int i, rc; + int i = 0, rc = 0; mutex_lock(&session_lock); for (i = 0; i < ASM_ACTIVE_STREAMS_ALLOWED; i++) { @@ -4366,7 +4366,7 @@ EXPORT_SYMBOL(q6asm_open_loopback_v2); int q6asm_open_loopback_with_retry(struct audio_client *ac, uint16_t bits_per_sample) { - int i, rc; + int i = 0, rc = 0; mutex_lock(&session_lock); for (i = 0; i < ASM_ACTIVE_STREAMS_ALLOWED; i++) {