ASoC: wm_adsp: Limit firmware control name to ALSA control name size
ALSA only supports control names up to 44 bytes, so there is no point allocating a whole page of memory to hold the control name, just limit the control name to 44 bytes. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
6958eb2ab2
commit
0f4e918cdf
1 changed files with 2 additions and 2 deletions
|
@ -789,7 +789,7 @@ static int wm_adsp_create_control(struct wm_adsp *dsp,
|
||||||
char *region_name;
|
char *region_name;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
name = kmalloc(PAGE_SIZE, GFP_KERNEL);
|
name = kmalloc(SNDRV_CTL_ELEM_ID_NAME_MAXLEN, GFP_KERNEL);
|
||||||
if (!name)
|
if (!name)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
@ -814,7 +814,7 @@ static int wm_adsp_create_control(struct wm_adsp *dsp,
|
||||||
goto err_name;
|
goto err_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf(name, PAGE_SIZE, "DSP%d %s %x",
|
snprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN, "DSP%d %s %x",
|
||||||
dsp->num, region_name, alg_region->alg);
|
dsp->num, region_name, alg_region->alg);
|
||||||
|
|
||||||
list_for_each_entry(ctl, &dsp->ctl_list,
|
list_for_each_entry(ctl, &dsp->ctl_list,
|
||||||
|
|
Loading…
Add table
Reference in a new issue