summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>2021-11-16 14:47:21 +0300
committerMark Brown <broonie@kernel.org>2021-11-16 17:29:49 +0300
commit6712c2e18c06b0976559fd4bd47774b243038e9c (patch)
treeea26b745193c53241f68e34c853c7edee563d358 /sound
parent0a270471d68533f59c5cfd631a3fce31a3b17144 (diff)
downloadlinux-6712c2e18c06b0976559fd4bd47774b243038e9c.tar.xz
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: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20211116114721.12517-6-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/qcom/qdsp6/q6routing.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/soc/qcom/qdsp6/q6routing.c b/sound/soc/qcom/qdsp6/q6routing.c
index 243b8179e59d..cd74681e811e 100644
--- a/sound/soc/qcom/qdsp6/q6routing.c
+++ b/sound/soc/qcom/qdsp6/q6routing.c
@@ -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);