Commit 6712c2e1 authored by Srinivas Kandagatla's avatar Srinivas Kandagatla Committed by Mark Brown

ASoC: qdsp6: q6routing: validate port id before setting up route

Validate port id before it starts sending commands to dsp this would
make error handling simpler.
Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20211116114721.12517-6-srinivas.kandagatla@linaro.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 0a270471
......@@ -372,6 +372,12 @@ int q6routing_stream_open(int fedai_id, int perf_mode,
}
session = &routing_data->sessions[stream_id - 1];
if (session->port_id < 0) {
dev_err(routing_data->dev, "Routing not setup for MultiMedia%d Session\n",
session->fedai_id);
return -EINVAL;
}
pdata = &routing_data->port_data[session->port_id];
mutex_lock(&routing_data->lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment