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

Commit 87a38fb7 authored by Walter Yang's avatar Walter Yang Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: Add backend user count check



Add backend user count check to protect the index
boundary.

Change-Id: Ic1b61d1f7130252cc54da0b16553858714988dbd
CRs-Fixed: 2009216
Signed-off-by: default avatarWalter Yang <yandongy@codeaurora.org>
parent 3649a615
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -680,6 +680,11 @@ static int soc_compr_set_params_fe(struct snd_compr_stream *cstream,
				cstream, &async_domain);
			} else {
				be_list[j++] = be;
				if (j == DPCM_MAX_BE_USERS) {
					dev_dbg(fe->dev,
						"ASoC: MAX backend users!\n");
					break;
				}
			}
		}
		for (i = 0; i < j; i++) {
+4 −0
Original line number Diff line number Diff line
@@ -2732,6 +2732,10 @@ void dpcm_be_dai_prepare_async(struct snd_soc_pcm_runtime *fe, int stream,
							    dpcm, domain);
		} else {
			dpcm_async[i++] = dpcm;
			if (i == DPCM_MAX_BE_USERS) {
				dev_dbg(fe->dev, "ASoC: MAX backend users!\n");
				break;
			}
		}
	}