diff options
author | Charles Keepax <ckeepax@opensource.wolfsonmicro.com> | 2015-04-13 13:27:56 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-04-27 15:38:24 +0100 |
commit | 0f4e918cdf81344b63571dfac4088efab34ec3ae (patch) | |
tree | 6ba9d154fb570e3125255400b3fc0beebafa4ac1 /sound/soc/codecs/wm_adsp.c | |
parent | 6958eb2ab206127ca92c00047a86816e125fc06b (diff) | |
download | linux-0f4e918cdf81344b63571dfac4088efab34ec3ae.tar.gz linux-0f4e918cdf81344b63571dfac4088efab34ec3ae.tar.bz2 linux-0f4e918cdf81344b63571dfac4088efab34ec3ae.zip |
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>
Diffstat (limited to 'sound/soc/codecs/wm_adsp.c')
-rw-r--r-- | sound/soc/codecs/wm_adsp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c index 3f6b49dc98c0..c2912033e3e3 100644 --- a/sound/soc/codecs/wm_adsp.c +++ b/sound/soc/codecs/wm_adsp.c @@ -789,7 +789,7 @@ static int wm_adsp_create_control(struct wm_adsp *dsp, char *region_name; int ret; - name = kmalloc(PAGE_SIZE, GFP_KERNEL); + name = kmalloc(SNDRV_CTL_ELEM_ID_NAME_MAXLEN, GFP_KERNEL); if (!name) return -ENOMEM; @@ -814,7 +814,7 @@ static int wm_adsp_create_control(struct wm_adsp *dsp, 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); list_for_each_entry(ctl, &dsp->ctl_list, |