sound/soc/sof/topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sof-pdata->machine is null on OF device, since get_function_tplg_files
is only implemented on ACPI device (machine and not of_machine),
check first for null machine.
Signed-off-by: Julien Massot <julien.massot@collabora.com>
Fixes: 6d5997c412cc ("ASoC: SOF: topology: load multiple topologies")
---
sound/soc/sof/topology.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c
index e19ba94f2c80a43731b90351bacfde2720db50ed..5d3ee3a86392c5a3fbfd05f83acc99b102c8cf61 100644
--- a/sound/soc/sof/topology.c
+++ b/sound/soc/sof/topology.c
@@ -2481,7 +2481,7 @@ int snd_sof_load_topology(struct snd_soc_component *scomp, const char *file)
if (!tplg_files)
return -ENOMEM;
- if (sof_pdata->machine->get_function_tplg_files) {
+ if (sof_pdata->machine && sof_pdata->machine->get_function_tplg_files) {
tplg_cnt = sof_pdata->machine->get_function_tplg_files(scomp->card,
sof_pdata->machine,
tplg_filename_prefix,
---
base-commit: 80626102e730787e2cdcab0e36d267bedcd1a63e
change-id: 20250428-fixup-of-sof-topology-50886568a785
Best regards,
--
Julien Massot <julien.massot@collabora.com>
… > check first for null machine. Would a summary phrase like “Prevent null pointer dereference in snd_sof_load_topology()” a bit nicer? Regards, Markus
On Mon, Apr 28, 2025 at 03:10:43PM +0200, Markus Elfring wrote: > … > > check first for null machine. > > Would a summary phrase like “Prevent null pointer dereference in snd_sof_load_topology()” > a bit nicer? Feel free to ignore Markus, he has a long history of sending unhelpful review comments and continues to ignore repeated requests to stop.
© 2016 - 2026 Red Hat, Inc.