| From d82a305afeda4f95f06c0323c6764feb4f04b849 Mon Sep 17 00:00:00 2001 |
| From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> |
| Date: Fri, 24 Jan 2020 15:36:20 -0600 |
| Subject: [PATCH] ASoC: SOF: core: free trace on errors |
| |
| commit 37e97e6faeabda405d0c4319f8419dcc3da14b2b upstream. |
| |
| free_trace() is not called on probe errors, fix |
| |
| Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> |
| Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> |
| Link: https://lore.kernel.org/r/20200124213625.30186-3-pierre-louis.bossart@linux.intel.com |
| Signed-off-by: Mark Brown <broonie@kernel.org> |
| Cc: stable@vger.kernel.org |
| Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| [PG: use 5.4.x-stable version.] |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c |
| index 5beda47cdf9f..f4c868b6d19c 100644 |
| --- a/sound/soc/sof/core.c |
| +++ b/sound/soc/sof/core.c |
| @@ -368,7 +368,7 @@ 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; |
| } |
| |
| drv_name = plat_data->machine->drv_name; |
| @@ -382,7 +382,7 @@ static int sof_probe_continue(struct snd_sof_dev *sdev) |
| |
| if (IS_ERR(plat_data->pdev_mach)) { |
| ret = PTR_ERR(plat_data->pdev_mach); |
| - goto fw_run_err; |
| + goto fw_trace_err; |
| } |
| |
| dev_dbg(sdev->dev, "created machine %s\n", |
| @@ -394,6 +394,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: |
| @@ -411,6 +413,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: |
| -- |
| 2.7.4 |
| |