mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 21:59:12 -04:00
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: Walter Yang <yandongy@codeaurora.org>
This commit is contained in:
parent
66b69d62de
commit
4f36922db2
2 changed files with 9 additions and 0 deletions
|
|
@ -691,6 +691,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++) {
|
||||
|
|
|
|||
|
|
@ -2761,6 +2761,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue