Skip to content
Unverified Commit 4d4e1b63 authored by Nícolas F. R. A. Prado's avatar Nícolas F. R. A. Prado Committed by Mark Brown
Browse files

ASoC: mediatek: mt8192: Check existence of dai_name before dereferencing

Following commit 13f58267

 ("ASoC: soc.h: don't create dummy
Component via COMP_DUMMY()"), the dai_name field is only populated for
dummy components after the card is registered. This causes a null
pointer dereference in the mt8192-mt6359 sound card driver's probe
function when searching for a dai_name among all the card's dai links.

Verify that the dai_name is non-null before passing it to strcmp. While
at it, also check that there's at least one codec.

Reported-by: default avatarkernelci.org bot <bot@kernelci.org>
Closes: https://linux.kernelci.org/test/case/id/6582cd6d992645c680e13478/
Fixes: 13f58267

 ("ASoC: soc.h: don't create dummy Component via COMP_DUMMY()")
Signed-off-by: default avatarNícolas F. R. A. Prado <nfraprado@collabora.com>
Link: https://msgid.link/r/20240108204508.691739-1-nfraprado@collabora.com
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 3ec71290
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment