Skip to contentSkip to conversation

ALSA: hda - Don't handle ELD notify from invalid port

PATCH New Takashi Iwai 1 participant 1 message Mar 10, 2016 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: hda - Don't handle ELD notify from invalid port

The current Intel HDMI codec driver supports only three fixed ports from port B to port D. However, i915 driver may assign a DP on other ports, e.g. port A, when no eDP is used. This incompatibility is caught later at pin_nid_to_pin_index() and results in a warning message like "HDMI: pin nid 4 not registered" at each time.

This patch filters out such invalid events beforehand, so that the kernel won't be too grumbling.

---
 sound/pci/hda/patch_hdmi.c | 4 ++++
 1 file changed, 4 insertions(+)
sound/pci/hda/patch_hdmi.c +4 -0
index bcbc4ee10130..b90e4f3967de 100644
@@ -2432,6 +2432,10 @@ static void intel_pin_eld_notify(void *audio_ptr, int port)
 	struct hda_codec *codec = audio_ptr;
 	int pin_nid = port + 0x04;
 
+	/* we assume only from port-B to port-D */
+	if (port < 1 || port > 3)
+		return;
+
 	/* skip notification during system suspend (but not in runtime PM);
 	 * the state will be updated at resume
 	 */
Signature · 1 line
2.7.2