mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 23:24:22 -04:00
ASoC: cs35l41: check cspl cmd input value
fix the below panic caused by google security test <6>[ 50.569557,4] [<ffffff800f8020cc>] cs35l41_cspl_cmd_put+0x3c/0x50 [cirrus_cs35l41] <6>[ 50.569571,4] [<ffffff8013dc43d4>] snd_ctl_elem_write+0x160/0x1c0 <6>[ 50.569584,4] [<ffffff8013dc5b64>] snd_ctl_ioctl+0x114/0xa78 <6>[ 50.569600,4] [<ffffff8013278b9c>] do_vfs_ioctl+0xd0/0xdb4 <6>[ 50.569613,4] [<ffffff8013279910>] SyS_ioctl+0x90/0xa4 <6>[ 50.569628,4] [<ffffff8013084380>] el0_svc_naked+0x34/0x38 <0>[ 50.569644,4] Code: b9404823 f9400c81 f9400c42 f9405c21 (b8635842) Change-Id: Ia69a5a6a8df1d47ad1e00559bbcc8Montana2cba47eb Signed-off-by: huangys <huangys@motorola.com> Reviewed-on: https://gerrit.mot.com/1246646 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Guobin Zhang <zhanggb@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
3f8f4acdca
commit
490ffc29b2
1 changed files with 3 additions and 0 deletions
|
|
@ -319,6 +319,9 @@ static int cs35l41_cspl_cmd_put(struct snd_kcontrol *kcontrol,
|
|||
unsigned int i = ucontrol->value.enumerated.item[0];
|
||||
int ret = 0;
|
||||
|
||||
if (i <0 || i >= sizeof(cs35l41_cspl_cmd_val)/sizeof(cs35l41_cspl_cmd_val[0]))
|
||||
return -EINVAL;
|
||||
|
||||
soc_enum = (struct soc_enum *)kcontrol->private_value;
|
||||
cs35l41->cspl_cmd = soc_enum->values[i];
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue