]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ASoC: soc-core: check ops & auto_selectable_formats in snd_soc_dai_get_fmt() to preve...
authorHariKrishna Sagala <hariconscious@gmail.com>
Thu, 30 Oct 2025 10:53:14 +0000 (16:23 +0530)
committerMark Brown <broonie@kernel.org>
Thu, 30 Oct 2025 14:32:19 +0000 (14:32 +0000)
commite73b743bfe8a6ff4e05b5657d3f7586a17ac3ba0
treec8631cc98ce7a201c0835396ff1772b3a50be2f7
parent6ef8e042cdcaabe3e3c68592ba8bfbaee2fa10a3
ASoC: soc-core: check ops & auto_selectable_formats in snd_soc_dai_get_fmt() to prevent dereference error

Smatch reported an issue that "ops" could be null (see
line 174) where later "ops" is dereferenced to extract
the dai fmts, also auto_selectable_formats can also be
null.

Add a proper null check before accessing both the ptrs
to ensure a safe execution.

Signed-off-by: HariKrishna Sagala <hariconscious@gmail.com>
Link: https://patch.msgid.link/20251030105313.32199-2-hariconscious@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-dai.c