mirror of
https://github.com/torvalds/linux.git
synced 2026-06-04 04:23:35 +02:00
ASoC: Intel: sof_sdw: Prevent jump to NULL add_sidecar callback
In create_sdw_dailink() check that sof_end->codec_info->add_sidecar
is not NULL before calling it.
The original code assumed that if include_sidecar is true, the codec
on that link has an add_sidecar callback. But there could be other
codecs on the same link that do not have an add_sidecar callback.
Fixes: da52441802 ("ASoC: Intel: sof_sdw: Add callbacks to register sidecar devices")
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20250919140235.1071941-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
62a7b3bbb6
commit
87cab86925
|
|
@ -841,7 +841,7 @@ static int create_sdw_dailink(struct snd_soc_card *card,
|
|||
(*codec_conf)++;
|
||||
}
|
||||
|
||||
if (sof_end->include_sidecar) {
|
||||
if (sof_end->include_sidecar && sof_end->codec_info->add_sidecar) {
|
||||
ret = sof_end->codec_info->add_sidecar(card, dai_links, codec_conf);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user