[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180903110747.10745-1-srinivas.kandagatla@linaro.org>
Date: Mon, 3 Sep 2018 12:07:47 +0100
From: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
To: broonie@...nel.org, alsa-devel@...a-project.org
Cc: linux-kernel@...r.kernel.org, bgoswami@...eaurora.org,
rohitkr@...eaurora.org,
Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Subject: [PATCH] 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@...aro.org>
---
sound/soc/qcom/qdsp6/q6routing.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
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)
{
int i;
- for (i = 0; i < MAX_SESSIONS; i++)
+ for (i = 0; i < MAX_SESSIONS; i++) {
routing_data->sessions[i].port_id = -1;
+ routing_data->sessions[i].fedai_id = -1;
+ }
return 0;
}
--
2.18.0
Powered by blists - more mailing lists