Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sound/soc/sof/intel/hda.c
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@ static void hda_generic_machine_select(struct snd_sof_dev *sdev,
if (!tplg_filename)
return;

hda_mach->sof_tplg_filename = tplg_filename;
pdata->tplg_filename = tplg_filename;
}
Comment on lines +1080 to 1081
Copy link

Copilot AI May 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change correctly stores the topology filename in pdata, avoiding the previous use-after-free issue when the global variable was freed during module unload.

Suggested change
pdata->tplg_filename = tplg_filename;
}
pdata->tplg_filename = kstrdup(tplg_filename, GFP_KERNEL);
if (!pdata->tplg_filename) {
dev_err(sdev->dev, "Failed to allocate memory for tplg_filename\n");
return;
}

Copilot uses AI. Check for mistakes.

if (codec_num == 2 ||
Expand Down
Loading