]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ALSA: hda/hdmi: Fix breakage at probing nvhdmi-mcp driver
authorTakashi Iwai <tiwai@suse.de>
Thu, 6 Nov 2025 10:46:45 +0000 (11:46 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Nov 2025 09:37:45 +0000 (10:37 +0100)
commit 82420bd4e17bdaba8453fbf9e10c58c9ed0c9727 upstream.

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")
Cc: <stable@vger.kernel.org>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=220743
Link: https://patch.msgid.link/20251106104647.25805-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/hda/codecs/hdmi/nvhdmi-mcp.c

index fbcea6d1850e622cb3b0f9c8e60964094831760e..a159aa6522f621c82d3f457abf8168c57c179c22 100644 (file)
@@ -351,8 +351,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,
 };