Merge branch 'asoc-4.18' into asoc-4.19 wmadsp dep
[muen/linux.git] / sound / soc / qcom / qdsp6 / q6afe-dai.c
index 139d24be3fb99bedf9d062476045ad8c6be5e817..60ff4a2d35774eebdaced12f36a275ce2738f5f2 100644 (file)
@@ -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;
                }