[PATCH] NOTFORUPSTREAM sound/hda: add debug information in call_hp_automute

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I would like to send this patch to the core-for-CI branch, in order to
verify the theory I exposed in fdo#101246.

This patch also hides a potentially serious bug in the sound/hda
driver, which may improve our chances of not being affected by
bugs there. It may actually also fix some of the incompletes we see.

This patch introduces a new keyword (INTEL-GFX-CI-WARN) that IGT can
pick up on in order to report a dmesg-warn.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101246
---
 sound/pci/hda/hda_generic.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index 557ecfcad158..a59f13d2ea45 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -4471,7 +4471,19 @@ EXPORT_SYMBOL_GPL(snd_hda_gen_mic_autoswitch);
 static void call_hp_automute(struct hda_codec *codec,
 			     struct hda_jack_callback *jack)
 {
-	struct hda_gen_spec *spec = codec->spec;
+	struct hda_gen_spec *spec;
+
+	if (!codec) {
+		printk("INTEL-GFX-CI-WARN: call_hp_automute called with codec == NULL");
+		return;
+	}
+
+	spec = codec->spec;
+	if (!spec) {
+		printk("INTEL-GFX-CI-WARN: call_hp_automute called with codec->spec == NULL");
+		return;
+	}
+
 	if (spec->hp_automute_hook)
 		spec->hp_automute_hook(codec, jack);
 	else
-- 
2.13.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux