summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDhananjay Kumar <dhakumar@codeaurora.org>2015-06-29 01:05:12 +0530
committerRashed Abdel-Tawab <rashed@linux.com>2015-10-09 18:28:45 -0400
commita3bc0b721165ddcb3645f7bda003549e0a53c2dc (patch)
tree1ec1787cf6afd76897a29806caaa7d6f907d9a63
parent4b0c1ecc8ecee1402423b858721f4bdf1d9d158b (diff)
downloadhardware_qcom_audio-a3bc0b721165ddcb3645f7bda003549e0a53c2dc.tar.gz
hardware_qcom_audio-a3bc0b721165ddcb3645f7bda003549e0a53c2dc.tar.bz2
hardware_qcom_audio-a3bc0b721165ddcb3645f7bda003549e0a53c2dc.zip
post_proc: fix crash in offload effect bundle during stop output
Effect bundle stop() frees mixer contol before doing module stop(), whereas module's stop() still needs this control to send disable command down the layer. Crash is observed if memory associated with effect control is reused and gets altered by the time mixer control is completed. Move mixer control's deletion after module's stop() to fix this issue. CRs-Fixed: 860604 Change-Id: Ia8b6d5f847b69392afbda1ba77fc740a47aba25d
-rw-r--r--post_proc/bundle.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/post_proc/bundle.c b/post_proc/bundle.c
index f6bec8a3..d6e57653 100644
--- a/post_proc/bundle.c
+++ b/post_proc/bundle.c
@@ -305,9 +305,6 @@ int offload_effects_bundle_hal_stop_output(audio_io_handle_t output, int pcm_id)
goto exit;
}
- if (out_ctxt->mixer)
- mixer_close(out_ctxt->mixer);
-
list_for_each(fx_node, &out_ctxt->effects_list) {
effect_context_t *fx_ctxt = node_to_item(fx_node,
effect_context_t,
@@ -316,6 +313,9 @@ int offload_effects_bundle_hal_stop_output(audio_io_handle_t output, int pcm_id)
fx_ctxt->ops.stop(fx_ctxt, out_ctxt);
}
+ if (out_ctxt->mixer)
+ mixer_close(out_ctxt->mixer);
+
list_remove(&out_ctxt->outputs_list_node);
#ifdef DTS_EAGLE