Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0fa7eff0 authored by Fred Oh's avatar Fred Oh
Browse files

ASoC: msm: qdsp6v2: fix copp_idx range check



copp_idx can never be less than 0 and at the same time greater than
MAX_COPPS_PER_PORT. So condition should be '||'.

Change-Id: I27aca9a31a38a75c0a01622aab113560e77e0bce
Signed-off-by: default avatarFred Oh <fred@codeaurora.org>
parent cb0b4937
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -603,7 +603,7 @@ int msm_pcm_routing_reg_phy_stream(int fedai_id, int perf_mode,
					    sample_rate, channels, topology,
					    perf_mode, bits_per_sample,
					    app_type, acdb_dev_id);
			if ((copp_idx < 0) &&
			if ((copp_idx < 0) ||
				(copp_idx >= MAX_COPPS_PER_PORT)) {
				pr_err("%s: adm open failed copp_idx:%d\n",
					__func__, copp_idx);
@@ -5291,7 +5291,7 @@ static int msm_pcm_routing_prepare(struct snd_pcm_substream *substream)
					    sample_rate, channels, topology,
					    fdai->perf_mode, bits_per_sample,
					    app_type, acdb_dev_id);
			if ((copp_idx < 0) &&
			if ((copp_idx < 0) ||
				(copp_idx >= MAX_COPPS_PER_PORT)) {
				pr_err("%s: adm open failed\n", __func__);
				return -EINVAL;