Skip to content

Commit 114a6e6

Browse files
Julien Massotbroonie
authored andcommitted
ASoC: SOF: topology: Fix null pointer dereference
The "get_function_tplg_files" function is only applicable to ACPI-based devices (sof_pdata->machine and not sof_pdata->of_machine). Skip this check for OF-based devices to avoid a NULL pointer dereference in snd_sof_load_topology(). Fixes: 6d5997c ("ASoC: SOF: topology: load multiple topologies") Reviewed-by: Laurentiu Mihalcea <[email protected]> Reviewed-by: Cristian Ciocaltea <[email protected]> Signed-off-by: Julien Massot <[email protected]> Reviewed-by: Daniel Baluta <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 85f380f commit 114a6e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/soc/sof/topology.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2481,7 +2481,7 @@ int snd_sof_load_topology(struct snd_soc_component *scomp, const char *file)
24812481
if (!tplg_files)
24822482
return -ENOMEM;
24832483

2484-
if (sof_pdata->machine->get_function_tplg_files) {
2484+
if (sof_pdata->machine && sof_pdata->machine->get_function_tplg_files) {
24852485
tplg_cnt = sof_pdata->machine->get_function_tplg_files(scomp->card,
24862486
sof_pdata->machine,
24872487
tplg_filename_prefix,

0 commit comments

Comments
 (0)