diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-06-28 05:51:32 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-25 17:07:24 -0400 |
commit | 3a72cf75a1e32aedfd68b4467e2677bf1c0eb5d4 (patch) | |
tree | dd3ddd29ce7c261979c7a188292365c50225d09a /sound | |
parent | 1f563ec40d24e0af579911dfbd6ac8856889bb89 (diff) |
ALSA: hda - Fix the max length of control name in generic parser
commit 0c055b3413868227f2e85701c4e6938c9581f0e2 upstream.
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.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/hda/hda_generic.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index 4b1524a861f3..24400cffb8f3 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c | |||
@@ -840,7 +840,7 @@ static int add_control_with_pfx(struct hda_gen_spec *spec, int type, | |||
840 | const char *pfx, const char *dir, | 840 | const char *pfx, const char *dir, |
841 | const char *sfx, int cidx, unsigned long val) | 841 | const char *sfx, int cidx, unsigned long val) |
842 | { | 842 | { |
843 | char name[32]; | 843 | char name[44]; |
844 | snprintf(name, sizeof(name), "%s %s %s", pfx, dir, sfx); | 844 | snprintf(name, sizeof(name), "%s %s %s", pfx, dir, sfx); |
845 | if (!add_control(spec, type, name, cidx, val)) | 845 | if (!add_control(spec, type, name, cidx, val)) |
846 | return -ENOMEM; | 846 | return -ENOMEM; |