ASoC: mediatek: mt8195: add dai id check before accessing array

Coverity shows "afe_priv->dai_priv[dai_id] evaluates to an address that
could be at negative offset of an array.". Add dai id check before
accessing the array element. This ensures that the offset of an array must
be a valid index.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20230307040938.7484-2-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Trevor Wu 2023-03-07 12:09:35 +08:00 • committed by Mark Brown
commit ff72889906
No known key found for this signature in database
GPG key ID: 24D68B725D5487D0
3 changed files with 185 additions and 35 deletions