asoc: lpass-cdc: fix for array out-of-bound

add fix for arry out-of-bound.

Change-Id: Ib73c41f4f9b14f21143d88b4d768285a674e5f65
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
This commit is contained in:
Prasad Kumpatla
2022-04-27 20:16:28 +05:30
committed by Gerrit - the friendly Code Review server
parent 806e22d256
commit 3aa51212be

View File

@@ -1327,6 +1327,12 @@ static int lpass_cdc_wsa_macro_config_compander(struct snd_soc_component *compon
if (!lpass_cdc_wsa_macro_get_data(component, &wsa_dev, &wsa_priv, __func__))
return -EINVAL;
if (comp >= LPASS_CDC_WSA_MACRO_COMP_MAX) {
dev_err(component->dev, "%s: Invalid compander value: %d\n",
__func__, comp);
return -EINVAL;
}
dev_dbg(component->dev, "%s: event %d compander %d, enabled %d\n",
__func__, event, comp + 1, wsa_priv->comp_enabled[comp]);