[PATCH] ASoC: SOF: Intel: Add error handling in hda_dsp_trace_release
![](https://secure.gravatar.com/avatar/4979b73834ec5b6c670c2b785af923c0.jpg?s=120&d=mm&r=g)
This patch adds error-handling for the hda_dsp_stream_put() inside the hda_dsp_trace_release function in the hda-trace.c file.
Signed-off-by: liuhaoran liuhaoran14@163.com --- sound/soc/sof/intel/hda-trace.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/sound/soc/sof/intel/hda-trace.c b/sound/soc/sof/intel/hda-trace.c index cbb9bd7770e6..5dcd43b9cbe4 100644 --- a/sound/soc/sof/intel/hda-trace.c +++ b/sound/soc/sof/intel/hda-trace.c @@ -73,13 +73,22 @@ int hda_dsp_trace_release(struct snd_sof_dev *sdev) { struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; struct hdac_stream *hstream; + int ret;
if (hda->dtrace_stream) { hstream = &hda->dtrace_stream->hstream; - hda_dsp_stream_put(sdev, + ret = hda_dsp_stream_put(sdev, SNDRV_PCM_STREAM_CAPTURE, hstream->stream_tag); + hda->dtrace_stream = NULL; + + if (ret < 0) { + dev_dbg(sdev->dev, + "stream put failed: %d\n", ret); + return ret; + } + return 0; }
![](https://secure.gravatar.com/avatar/59bffa8d29505a5951521a2fd09a4fd9.jpg?s=120&d=mm&r=g)
On 9/23/23 05:12, liuhaoran wrote:
This patch adds error-handling for the hda_dsp_stream_put() inside the hda_dsp_trace_release function in the hda-trace.c file.
Signed-off-by: liuhaoran liuhaoran14@163.com
sound/soc/sof/intel/hda-trace.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/sound/soc/sof/intel/hda-trace.c b/sound/soc/sof/intel/hda-trace.c index cbb9bd7770e6..5dcd43b9cbe4 100644 --- a/sound/soc/sof/intel/hda-trace.c +++ b/sound/soc/sof/intel/hda-trace.c @@ -73,13 +73,22 @@ int hda_dsp_trace_release(struct snd_sof_dev *sdev) { struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; struct hdac_stream *hstream;
int ret;
if (hda->dtrace_stream) { hstream = &hda->dtrace_stream->hstream;
hda_dsp_stream_put(sdev,
ret = hda_dsp_stream_put(sdev, SNDRV_PCM_STREAM_CAPTURE, hstream->stream_tag);
- hda->dtrace_stream = NULL;
if (ret < 0) {
dev_dbg(sdev->dev,
"stream put failed: %d\n", ret);
return ret;
}
I don't know if returning an error helps here, this might get in the way of the suspend.
Peter, what do you think?
return 0;
}
participants (2)
-
liuhaoran
-
Pierre-Louis Bossart