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 <laurentiu.mihalcea@nxp.com> Reviewed-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Signed-off-by: Julien Massot <julien.massot@collabora.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Link: https://patch.msgid.link/20250429-fixup-of-sof-topology-v4-1-ff692244d64c@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 85f380f commit 114a6e6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)