提交 0c055b34 编写于 作者: T Takashi Iwai

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: NTakashi Iwai <tiwai@suse.de>
上级 cd6fb679
...@@ -854,7 +854,7 @@ static int add_control_with_pfx(struct hda_gen_spec *spec, int type, ...@@ -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 *pfx, const char *dir,
const char *sfx, int cidx, unsigned long val) const char *sfx, int cidx, unsigned long val)
{ {
char name[32]; char name[44];
snprintf(name, sizeof(name), "%s %s %s", pfx, dir, sfx); snprintf(name, sizeof(name), "%s %s %s", pfx, dir, sfx);
if (!add_control(spec, type, name, cidx, val)) if (!add_control(spec, type, name, cidx, val))
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册