diff options
author | Mark Brown <broonie@kernel.org> | 2018-08-09 14:46:56 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-08-09 14:46:56 +0100 |
commit | 6c084839877666d987ff8bc4e0facd3c02d99d61 (patch) | |
tree | 714675fae123ffbe42dd04892be2561ac34d1d8d /sound/soc/qcom/qdsp6/q6afe-dai.c | |
parent | 1ffaddd029c867d134a1dde39f540dcc8c52e274 (diff) | |
parent | 0717edbdfed61b4c1e8291140f78882d3a481042 (diff) |
Merge branch 'asoc-4.18' into asoc-linus
Diffstat (limited to 'sound/soc/qcom/qdsp6/q6afe-dai.c')
-rw-r--r-- | sound/soc/qcom/qdsp6/q6afe-dai.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/soc/qcom/qdsp6/q6afe-dai.c b/sound/soc/qcom/qdsp6/q6afe-dai.c index 5002dd05bf27..9ba95956ada8 100644 --- a/sound/soc/qcom/qdsp6/q6afe-dai.c +++ b/sound/soc/qcom/qdsp6/q6afe-dai.c @@ -315,6 +315,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); @@ -1180,7 +1183,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; } |