From 4ccebb9bf00385b652dc2d71f66f6f82c90469a2 Mon Sep 17 00:00:00 2001 From: Kunlei Zhang Date: Mon, 23 Nov 2020 09:56:28 +0800 Subject: [PATCH] dsp: ensure unassign memory happen when pause voice call failed When voice call pause failed, cvp cal deregister is not called to make hyp unassign memory happen. Fix it by calling cvp cal deregister even if voice call pause failed. Change-Id: I88afa951e0be50ca06509e9e51ce484b75dcc7d4 Signed-off-by: Kunlei Zhang --- dsp/q6voice.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/dsp/q6voice.c b/dsp/q6voice.c index 2ecf6ba36968..17174d162332 100644 --- a/dsp/q6voice.c +++ b/dsp/q6voice.c @@ -3945,20 +3945,20 @@ static int voice_unmap_cal_memory(int32_t cal_type, __func__, v->session_id, result2); result = result2; - } else { - if (cal_type == CVP_VOCPROC_DYNAMIC_CAL_TYPE) - voice_send_cvp_deregister_vol_cal_cmd(v); - else if (cal_type == CVP_VOCPROC_STATIC_CAL_TYPE) - voice_send_cvp_deregister_cal_cmd(v); - else if (cal_type == CVP_VOCDEV_CFG_CAL_TYPE) - voice_send_cvp_deregister_dev_cfg_cmd(v); - else if (cal_type == CVS_VOCSTRM_STATIC_CAL_TYPE) - voice_send_cvs_deregister_cal_cmd(v); - else - pr_err("%s: Invalid cal type %d!\n", - __func__, cal_type); } + if (cal_type == CVP_VOCPROC_DYNAMIC_CAL_TYPE) + voice_send_cvp_deregister_vol_cal_cmd(v); + else if (cal_type == CVP_VOCPROC_STATIC_CAL_TYPE) + voice_send_cvp_deregister_cal_cmd(v); + else if (cal_type == CVP_VOCDEV_CFG_CAL_TYPE) + voice_send_cvp_deregister_dev_cfg_cmd(v); + else if (cal_type == CVS_VOCSTRM_STATIC_CAL_TYPE) + voice_send_cvs_deregister_cal_cmd(v); + else + pr_err("%s: Invalid cal type %d!\n", + __func__, cal_type); + result2 = voice_send_start_voice_cmd(v); if (result2) { pr_err("%s: Voice_send_start_voice_cmd failed for session 0x%x, err %d!\n",