[alsa-devel] [BUG] NULL pointer dereference in patch_sigmatel.c

Takashi Iwai tiwai at suse.de
Fri Aug 7 11:56:08 CEST 2009


At Fri, 7 Aug 2009 10:43:07 +0100,
James Courtier-Dutton wrote:
> 
> 2009/8/7 Ozan Çağlayan <ozan at pardus.org.tr>:
> >
> > Added the following lines:
> >
> > printk(KERN_INFO "0x%p\n", jack);
> > printk(KERN_INFO "0x%p\n", jack->jack);
> > printk(KERN_INFO "0x%p\n", jack->jack->private_data);
> >
> > dmesg:
> >
> > NVRM: loading NVIDIA UNIX x86 Kernel Module  180.51  Thu Apr 16 19:02:15
> > PDT 2009
> > ACPI: PCI Interrupt 0000:00:1b.0[A] -> GSI 22 (level, low) -> IRQ 22
> > PCI: Setting latency timer of device 0000:00:1b.0 to 64
> > 0xf777a614
> > 0x00000000
> > BUG: unable to handle kernel NULL pointer dereference at 00000074
> > IP: [<f93f2d97>] :snd_hda_codec_conexant:conexant_add_jack+0x57/0x81
> > *pde = 00000000·
> > Oops: 0000 [#1] SMP
> >
> 
> Need more of the dmesg output.
> I.e. to see which print statements succeeded.
> Alternatively, attach the snd_hda.ko so one can see where in that file
> offset 0x57 is.
> But a more useful print would be:
> if (!jack) printk(KERN_INFO "jack null\n");
> else if (!(jack->jack)) printk(KERN_INFO "jack->jack null\n");
> else if (!(jack->jack->private_data)) printk(KERN_INFO
> "jack->jack->private_data null\n");

Well, it's fairly obvious that jack->jack is NULL as the second
output is NULL, and the third one hits Oops.

Ozan, could you check whether CONFIG_SND_JACK is set in
stac92xx_add_jack, e.g. like below?


Takashi

---
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index a75d6a0..e131e0d 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -4185,6 +4185,9 @@ static int stac92xx_add_jack(struct hda_codec *codec,
 		hda_nid_t nid, int type)
 {
 #ifdef CONFIG_SND_HDA_INPUT_JACK
+#ifndef CONFIG_SND_JACK
+#error XXX
+#endif
 	struct sigmatel_spec *spec = codec->spec;
 	struct sigmatel_jack *jack;
 	int def_conf = snd_hda_codec_get_pincfg(codec, nid);


More information about the Alsa-devel mailing list