Commit f5b2d0ef authored by Wu Fengguang's avatar Wu Fengguang Committed by Takashi Iwai

ALSA: HDMI - fix ELD monitor name length

I noticed that the last character of the ELD monitor name is lost,
this fixes the issue.

This fix should be confirming to the HDA spec, and works together with
the DRM part of the ELD patch.

The HDA spec does not mention that Monitor_Name_String is an '\0'
ending string, and it allows NML to be 1, which is only valid when MNL
does not count the possible ending '\0'.
Signed-off-by: default avatarWu Fengguang <fengguang.wu@intel.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 0cfae7c9
...@@ -294,7 +294,7 @@ static int hdmi_update_eld(struct hdmi_eld *e, ...@@ -294,7 +294,7 @@ static int hdmi_update_eld(struct hdmi_eld *e,
snd_printd(KERN_INFO "HDMI: out of range MNL %d\n", mnl); snd_printd(KERN_INFO "HDMI: out of range MNL %d\n", mnl);
goto out_fail; goto out_fail;
} else } else
strlcpy(e->monitor_name, buf + ELD_FIXED_BYTES, mnl); strlcpy(e->monitor_name, buf + ELD_FIXED_BYTES, mnl + 1);
for (i = 0; i < e->sad_count; i++) { for (i = 0; i < e->sad_count; i++) {
if (ELD_FIXED_BYTES + mnl + 3 * (i + 1) > size) { if (ELD_FIXED_BYTES + mnl + 3 * (i + 1) > size) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment