Skip to contentSkip to conversation

ALSA: hda/hdmi: Fix breakage at probing nvhdmi-mcp driver

PATCH New Takashi Iwai 1 participant 1 message Nov 6, 2025 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: hda/hdmi: Fix breakage at probing nvhdmi-mcp driver

After restructuring and splitting the HDMI codec driver code, each HDMI codec driver contains the own build_controls and build_pcms ops. A copy-n-paste error put the wrong entries for nvhdmi-mcp driver; both build_controls and build_pcms are swapped. Unfortunately both callbacks have the very same form, and the compiler didn't complain it, either. This resulted in a NULL dereference because the PCM instance hasn't been initialized at calling the build_controls callback.

Fix it by passing the proper entries.

Fixes ad781b550f9a ("ALSA: hda/hdmi: Rewrite to new probe method")
---
 sound/hda/codecs/hdmi/nvhdmi-mcp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/hda/codecs/hdmi/nvhdmi-mcp.c +2 -2
index 8fd8d76fa72f..1c5fdfe872f2 100644
@@ -350,8 +350,8 @@ static int nvhdmi_mcp_probe(struct hda_codec *codec,
 static const struct hda_codec_ops nvhdmi_mcp_codec_ops = {
 	.probe = nvhdmi_mcp_probe,
 	.remove = snd_hda_hdmi_simple_remove,
-	.build_controls = nvhdmi_mcp_build_pcms,
-	.build_pcms = nvhdmi_mcp_build_controls,
+	.build_pcms = nvhdmi_mcp_build_pcms,
+	.build_controls = nvhdmi_mcp_build_controls,
 	.init = nvhdmi_mcp_init,
 	.unsol_event = snd_hda_hdmi_simple_unsol_event,
 };
Signature · 1 line
2.50.1