aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>2018-09-03 07:07:47 -0400
committerMark Brown <broonie@kernel.org>2018-09-03 07:17:32 -0400
commit7aa09ff24301535491cd4de1b93107ee91449a12 (patch)
tree06f7a8bb58bddaef18a7ed6cc96a025d2fe2a78b
parentd40e3e9e44db4b3c8777f3b515ba6097ba26e3b2 (diff)
ASoC: q6routing: initialize data correctly
Some of the router data fields are left as default zeros which are valid dai ids, so initialize these to invalid value of -1. Without intializing these correctly get_session_from_id() can return incorrect session resulting in not closing the opened copp and messing up with the copp ref count. Fixes: e3a33673e845 ("ASoC: qdsp6: q6routing: Add q6routing driver") Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/qcom/qdsp6/q6routing.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/soc/qcom/qdsp6/q6routing.c b/sound/soc/qcom/qdsp6/q6routing.c
index dc94c5c53788..c6b51571be94 100644
--- a/sound/soc/qcom/qdsp6/q6routing.c
+++ b/sound/soc/qcom/qdsp6/q6routing.c
@@ -960,8 +960,10 @@ static int msm_routing_probe(struct snd_soc_component *c)
960{ 960{
961 int i; 961 int i;
962 962
963 for (i = 0; i < MAX_SESSIONS; i++) 963 for (i = 0; i < MAX_SESSIONS; i++) {
964 routing_data->sessions[i].port_id = -1; 964 routing_data->sessions[i].port_id = -1;
965 routing_data->sessions[i].fedai_id = -1;
966 }
965 967
966 return 0; 968 return 0;
967} 969}