diff --git a/asoc/codecs/wcd9335.c b/asoc/codecs/wcd9335.c index 8564ac1a00c3..3ec94fe7d988 100644 --- a/asoc/codecs/wcd9335.c +++ b/asoc/codecs/wcd9335.c @@ -2372,10 +2372,10 @@ static int slim_tx_mixer_put(struct snd_kcontrol *kcontrol, mutex_lock(&tasha_p->codec_mutex); - if (tasha_p->intf_type != WCD9XXX_INTERFACE_TYPE_SLIMBUS) { - if (dai_id != AIF1_CAP) { - dev_err(codec->dev, "%s: invalid AIF for I2C mode\n", - __func__); + if (tasha_p->intf_type == WCD9XXX_INTERFACE_TYPE_SLIMBUS) { + if (dai_id >= ARRAY_SIZE(vport_slim_check_table)) { + dev_err(codec->dev, "%s: dai_id: %d, out of bounds\n", + __func__, dai_id); mutex_unlock(&tasha_p->codec_mutex); return -EINVAL; }