From: Julien Massot Date: Tue, 29 Apr 2025 09:19:22 +0000 (+0200) Subject: ASoC: SOF: topology: Fix null pointer dereference X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=114a6e63d9cc11311587773d5db4cf4105cf658f;p=users%2Fjedix%2Flinux-maple.git 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: 6d5997c412cc ("ASoC: SOF: topology: load multiple topologies") Reviewed-by: Laurentiu Mihalcea Reviewed-by: Cristian Ciocaltea Signed-off-by: Julien Massot Reviewed-by: Daniel Baluta Link: https://patch.msgid.link/20250429-fixup-of-sof-topology-v4-1-ff692244d64c@collabora.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c index e19ba94f2c80a..5d3ee3a86392c 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,