ASoC: msm: Return failure for invalid port id.
Return failure if port id is invalid.
Signed-off-by: Bharath Ramachandramurthy <bramacha@codeaurora.org>
diff --git a/sound/soc/msm/qdsp6/q6adm.c b/sound/soc/msm/qdsp6/q6adm.c
index fbe5f86..439b757 100644
--- a/sound/soc/msm/qdsp6/q6adm.c
+++ b/sound/soc/msm/qdsp6/q6adm.c
@@ -750,6 +750,8 @@
int ret = 0;
int index = afe_get_port_index(port_id);
+ if (afe_validate_port(port_id) < 0)
+ return -EINVAL;
pr_info("%s port_id=%d index %d\n", __func__, port_id, index);