Skip to content

Commit

Permalink
ASoC: q6routing: initialize data correctly
Browse files Browse the repository at this point in the history
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: e3a3367 ("ASoC: qdsp6: q6routing: Add q6routing driver")
Signed-off-by: Srinivas Kandagatla <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
Srinivas-Kandagatla authored and broonie committed Sep 3, 2018
1 parent d40e3e9 commit 7aa09ff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sound/soc/qcom/qdsp6/q6routing.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 7aa09ff

Please sign in to comment.