Skip to content

Commit

Permalink
ASoC: SOF: core: free trace on errors
Browse files Browse the repository at this point in the history
free_trace() is not called on probe errors, fix

Reviewed-by: Kai Vehmanen <[email protected]>
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Cc: [email protected]
  • Loading branch information
plbossart authored and broonie committed Jan 27, 2020
1 parent 4f7f956 commit 37e97e6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sound/soc/sof/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,12 @@ static int sof_probe_continue(struct snd_sof_dev *sdev)
if (ret < 0) {
dev_err(sdev->dev,
"error: failed to register DSP DAI driver %d\n", ret);
goto fw_run_err;
goto fw_trace_err;
}

ret = snd_sof_machine_register(sdev, plat_data);
if (ret < 0)
goto fw_run_err;
goto fw_trace_err;

/*
* Some platforms in SOF, ex: BYT, may not have their platform PM
Expand All @@ -245,6 +245,8 @@ static int sof_probe_continue(struct snd_sof_dev *sdev)
return 0;

#if !IS_ENABLED(CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE)
fw_trace_err:
snd_sof_free_trace(sdev);
fw_run_err:
snd_sof_fw_unload(sdev);
fw_load_err:
Expand All @@ -262,6 +264,7 @@ static int sof_probe_continue(struct snd_sof_dev *sdev)
* snd_sof_device_remove() when the PCI/ACPI device is removed
*/

fw_trace_err:
fw_run_err:
fw_load_err:
ipc_err:
Expand Down

0 comments on commit 37e97e6

Please sign in to comment.