summaryrefslogtreecommitdiff
path: root/sound/soc/qcom/qdsp6
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/qcom/qdsp6')
-rw-r--r--sound/soc/qcom/qdsp6/q6afe-dai.c5
-rw-r--r--sound/soc/qcom/qdsp6/q6asm-dai.c4
-rw-r--r--sound/soc/qcom/qdsp6/q6routing.c2
3 files changed, 8 insertions, 3 deletions
diff --git a/sound/soc/qcom/qdsp6/q6afe-dai.c b/sound/soc/qcom/qdsp6/q6afe-dai.c
index 139d24be3fb9..60ff4a2d3577 100644
--- a/sound/soc/qcom/qdsp6/q6afe-dai.c
+++ b/sound/soc/qcom/qdsp6/q6afe-dai.c
@@ -313,6 +313,9 @@ static void q6afe_dai_shutdown(struct snd_pcm_substream *substream,
struct q6afe_dai_data *dai_data = dev_get_drvdata(dai->dev);
int rc;
+ if (!dai_data->is_port_started[dai->id])
+ return;
+
rc = q6afe_port_stop(dai_data->port[dai->id]);
if (rc < 0)
dev_err(dai->dev, "fail to close AFE port (%d)\n", rc);
@@ -1332,7 +1335,7 @@ static void of_q6afe_parse_dai_data(struct device *dev,
int id, i, num_lines;
ret = of_property_read_u32(node, "reg", &id);
- if (ret || id > AFE_PORT_MAX) {
+ if (ret || id < 0 || id >= AFE_PORT_MAX) {
dev_err(dev, "valid dai id not found:%d\n", ret);
continue;
}
diff --git a/sound/soc/qcom/qdsp6/q6asm-dai.c b/sound/soc/qcom/qdsp6/q6asm-dai.c
index acf96c6549fc..9db9a2944ef2 100644
--- a/sound/soc/qcom/qdsp6/q6asm-dai.c
+++ b/sound/soc/qcom/qdsp6/q6asm-dai.c
@@ -389,7 +389,9 @@ static int q6asm_dai_close(struct snd_pcm_substream *substream)
struct q6asm_dai_rtd *prtd = runtime->private_data;
if (prtd->audio_client) {
- q6asm_cmd(prtd->audio_client, CMD_CLOSE);
+ if (prtd->state)
+ q6asm_cmd(prtd->audio_client, CMD_CLOSE);
+
q6asm_unmap_memory_regions(substream->stream,
prtd->audio_client);
q6asm_audio_client_free(prtd->audio_client);
diff --git a/sound/soc/qcom/qdsp6/q6routing.c b/sound/soc/qcom/qdsp6/q6routing.c
index 1d33b00e5b44..dc94c5c53788 100644
--- a/sound/soc/qcom/qdsp6/q6routing.c
+++ b/sound/soc/qcom/qdsp6/q6routing.c
@@ -926,7 +926,7 @@ static int routing_hw_params(struct snd_pcm_substream *substream,
else
path_type = ADM_PATH_LIVE_REC;
- if (be_id > AFE_MAX_PORTS)
+ if (be_id >= AFE_MAX_PORTS)
return -EINVAL;
session = &data->port_data[be_id];