summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-06-28 09:51:32 (GMT)
committerTakashi Iwai <tiwai@suse.de>2013-06-28 10:13:58 (GMT)
commit0c055b3413868227f2e85701c4e6938c9581f0e2 (patch)
treeb227d79491a93fef304bddf29f93dbe4651d1929 /sound
parentcd6fb6793a33e2b02af6e05a8d3f735f7c88a943 (diff)
downloadlinux-fsl-qoriq-0c055b3413868227f2e85701c4e6938c9581f0e2.tar.xz
ALSA: hda - Fix the max length of control name in generic parser
add_control_with_pfx() in hda_generic.c assumes a shorter name string for the control element, and this resulted in the truncation of the long but valid string like "Headphone Surround Switch" in the middle. This patch aligns the max size to the actual limit of snd_ctl_elem_id, 44. Cc: <stable@vger.kernel.org> [v3.9+] Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/hda_generic.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index 1485d87..6460fc5 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -854,7 +854,7 @@ static int add_control_with_pfx(struct hda_gen_spec *spec, int type,
const char *pfx, const char *dir,
const char *sfx, int cidx, unsigned long val)
{
- char name[32];
+ char name[44];
snprintf(name, sizeof(name), "%s %s %s", pfx, dir, sfx);
if (!add_control(spec, type, name, cidx, val))
return -ENOMEM;