Skip to contentSkip to conversation

HDMI - fix ELD monitor name length

PATCH Applied Wu Fengguang 2 participants 3 messages Jun 29, 2011 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HDMI - fix ELD monitor name length

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

---
 sound/pci/hda/hda_eld.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/hda_eld.c +1 -1
@@ -294,7 +294,7 @@ static int hdmi_update_eld(struct hdmi_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) {
#1 lore raw

Takashi,

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'.

Thanks,
Fengguang

Quoted 19 lines · Wu Fengguang

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

---
 sound/pci/hda/hda_eld.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/hda_eld.c +1 -1
@@ -294,7 +294,7 @@ static int hdmi_update_eld(struct hdmi_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) {
Applied
#2 lore raw
In reply to Wu Fengguang

At Wed, 29 Jun 2011 14:26:07 +0800,

Quoted 5 lines · Wu Fengguang

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

Thanks, applied now (with more changelog comments from your follow-up mail).

Takashi

Quoted 16 lines
---
 sound/pci/hda/hda_eld.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/hda_eld.c +1 -1
@@ -294,7 +294,7 @@ static int hdmi_update_eld(struct hdmi_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) {