sound/soc/sof/topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Check if "sof_pdata->machine" is NULL before calling the machine-specific
"get_function_tplg_files()". Otherwise, for OF-based machines (which set
the "of_machine" instead of the "machine" field), the operation will
result in a NULL pointer dereference fault.
Fixes: 6d5997c412cc ("ASoC: SOF: topology: load multiple topologies")
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
---
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 e19ba94f2c80..5d3ee3a86392 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,
--
2.34.1
On Mon, Apr 28, 2025 at 7:16 PM Laurentiu Mihalcea
<laurentiumihalcea111@gmail.com> wrote:
>
> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>
> Check if "sof_pdata->machine" is NULL before calling the machine-specific
> "get_function_tplg_files()". Otherwise, for OF-based machines (which set
> the "of_machine" instead of the "machine" field), the operation will
> result in a NULL pointer dereference fault.
>
> Fixes: 6d5997c412cc ("ASoC: SOF: topology: load multiple topologies")
> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
I think same patch was sent by Julien, but this one has better explanation.
Julien, I think you can add your S-o-B tag here.
Thanks,
Daniel.
On 4/28/2025 7:50 PM, Daniel Baluta wrote:
> On Mon, Apr 28, 2025 at 7:16 PM Laurentiu Mihalcea
> <laurentiumihalcea111@gmail.com> wrote:
>> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>>
>> Check if "sof_pdata->machine" is NULL before calling the machine-specific
>> "get_function_tplg_files()". Otherwise, for OF-based machines (which set
>> the "of_machine" instead of the "machine" field), the operation will
>> result in a NULL pointer dereference fault.
>>
>> Fixes: 6d5997c412cc ("ASoC: SOF: topology: load multiple topologies")
>> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
>
> I think same patch was sent by Julien, but this one has better explanation.
>
> Julien, I think you can add your S-o-B tag here.
>
> Thanks,
> Daniel.
sorry for the noise, somehow I missed Julien's patch. Dropping this in favor of
his.
© 2016 - 2025 Red Hat, Inc.