mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 21:59:12 -04:00
fix tfa NULL ptr memory exception
For "NXP Volume" and "NXP mode" mixer, we need to increase nr_controls. Change-Id: I93e8a8d62908d8c8681fa10ff7efc3e96922b996 Signed-off-by: guoyf2 <guoyf2@lenovo.com> Reviewed-on: https://gerrit.mot.com/1276325 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Yunfei Guo <guoyf2@motorola.com> Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com> Reviewed-by: Jianguo Liu <liujg6@motorola.com> Reviewed-by: Wanlong Zhou <zhouwl@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
dd9dd4ed04
commit
b0219ff89b
1 changed files with 3 additions and 1 deletions
|
|
@ -1684,7 +1684,9 @@ static int tfa98xx_create_controls(struct tfa98xx *tfa98xx)
|
|||
|
||||
#ifdef TFA9874_NONDSP_STEREO
|
||||
nr_controls += 1; /* for TFA_CHIP_SELECTOR */
|
||||
nr_controls += 1; /* for NXP Volume */
|
||||
#endif
|
||||
nr_controls += 1; /* for NXP Mode */
|
||||
|
||||
/* allocate the tfa98xx_controls base on the nr of profiles */
|
||||
nprof = tfa_cnt_get_dev_nprof(tfa98xx->tfa);
|
||||
|
|
@ -1695,7 +1697,7 @@ static int tfa98xx_create_controls(struct tfa98xx *tfa98xx)
|
|||
|
||||
tfa98xx_controls = devm_kzalloc(tfa98xx->codec->dev,
|
||||
nr_controls * sizeof(tfa98xx_controls[0]), GFP_KERNEL);
|
||||
if (!tfa98xx_controls)
|
||||
if (!tfa98xx_controls)
|
||||
return -ENOMEM;
|
||||
|
||||
/* Create a mixer item for selecting the active profile */
|
||||
|
|
|
|||
Loading…
Reference in a new issue