BZ: 29782
Cancel the workqueue first and then close it to avoid close
and the workqueue is still running.
Change-Id: I943e68a5430a250d47acf2d3106a5a810b9a13c6
Signed-off-by: he, bo <bo.he@intel.com>
Signed-off-by: zhang, yanmin <yanmin.zhang@intel.com>
Reviewed-on: http://android.intel.com:8080/41935
Reviewed-by: Mendi, EduardoX <eduardox.mendi@intel.com>
Tested-by: Mendi, EduardoX <eduardox.mendi@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
WARN(!substream->runtime, "ALSA_IFX: ERROR NULL substream->runtime\n");
if (!substream->runtime)
return -EINVAL;
+
str_info = substream->runtime->private_data;
if (str_info) {
+ /* Cancel pending work */
+ cancel_work_sync(&str_info->ssp_ws);
+
/* SST API to actually stop/free the stream */
ret_val = intel_alsa_ifx_control(INTEL_ALSA_SSP_CTRL_SND_CLOSE,
str_info);
p_alsa_ifx_snd_card->playback_cnt,
p_alsa_ifx_snd_card->capture_cnt);
- /* Cancel pending work */
- cancel_work_sync(&str_info->ssp_ws);
-
kfree(substream->runtime->private_data);
return ret_val;
WARN(!substream->runtime, "ALSA_SSP: ERROR NULL substream->runtime\n");
if (!substream->runtime)
return -EINVAL;
+
str_info = substream->runtime->private_data;
if (str_info) {
+ /* Cancel pending work */
+ cancel_work_sync(&str_info->ssp_ws);
+
/* SST API to actually stop/free the stream */
ret_val = intel_alsa_ssp_control(INTEL_ALSA_SSP_CTRL_SND_CLOSE,
str_info);
p_alsa_ssp_snd_card->playback_cnt,
p_alsa_ssp_snd_card->capture_cnt);
- /* Cancel pending work */
- cancel_work_sync(&str_info->ssp_ws);
-
kfree(substream->runtime->private_data);
return ret_val;