Skip to content

Commit

Permalink
ALSA: HDMI - fix ELD monitor name length
Browse files Browse the repository at this point in the history
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: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Wu Fengguang authored and Takashi Iwai committed Jun 29, 2011
1 parent 0cfae7c commit f5b2d0e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/pci/hda/hda_eld.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
goto out_fail;
} 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++) {
if (ELD_FIXED_BYTES + mnl + 3 * (i + 1) > size) {
Expand Down

0 comments on commit f5b2d0e

Please sign in to comment.