mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 16:16:15 -04:00
asoc: Add check for valid backend index
Add check for valid backend index in msm_routing_put_port_chmap_mixer. Change-Id: I8cda2313a38aaacc5255b47321ccfd0d573e1cfb Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
This commit is contained in:
parent
f138524159
commit
2b4cbd8cda
1 changed files with 5 additions and 0 deletions
|
|
@ -28870,6 +28870,11 @@ static int msm_routing_put_port_chmap_mixer(struct snd_kcontrol *kcontrol,
|
|||
uint32_t be_idx = ucontrol->value.integer.value[0];
|
||||
int i;
|
||||
|
||||
if (be_idx >= MSM_BACKEND_DAI_MAX) {
|
||||
pr_err("%s: Invalid Backend index %d\n", __func__, be_idx);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
for (i = 0; i < PCM_FORMAT_MAX_NUM_CHANNEL_V8; i++) {
|
||||
channel_map[i] = (char)(ucontrol->value.integer.value[i + 1]);
|
||||
if (channel_map[i] > PCM_MAX_CHMAP_ID) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue