Skip to content

Commit 87cab86

Browse files
rfvirgilbroonie
authored andcommitted
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: da52441 ("ASoC: Intel: sof_sdw: Add callbacks to register sidecar devices") Signed-off-by: Richard Fitzgerald <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 62a7b3b commit 87cab86

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/soc/intel/boards/sof_sdw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ static int create_sdw_dailink(struct snd_soc_card *card,
841841
(*codec_conf)++;
842842
}
843843

844-
if (sof_end->include_sidecar) {
844+
if (sof_end->include_sidecar && sof_end->codec_info->add_sidecar) {
845845
ret = sof_end->codec_info->add_sidecar(card, dai_links, codec_conf);
846846
if (ret)
847847
return ret;

0 commit comments

Comments
 (0)