⬢ DragonFlyBSD Kernel Audit
DF-4727 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/sound/pci/aureal.c
+++ b/sys/dev/sound/pci/aureal.c
@@ -408,8 +408,11 @@ au_intr (void *p)
 	if (intsrc & AU_IRQ_UNKNOWN) {
 		(void)au_rd(au, 0, AU_REG_UNK1, 4);
 		au_wr(au, 0, AU_REG_UNK1, 0, 4);
 		au_wr(au, 0, AU_REG_UNK1, 0x10000, 4);
 	}
 	if (intsrc & AU_IRQ_PCMOUT) {
-	       	i=au_rd(au, 0, AU_REG_UNK2, 4) & (AU_BUFFSIZE-1);
-	       	chn_intr(au->pch.channel);
+		/* au->pch.channel is NULL until pcm_addchan() ran
+		 * (auchan_init); chn_intr(NULL) would deref it
+		 * (CHN_LOCKOWNED) and panic (DF-4727). */
+		if (au->pch.channel != NULL)
+			chn_intr(au->pch.channel);
 		(void)au_rd(au, 0, AU_REG_UNK3, 4);
 		(void)au_rd(au, 0, AU_REG_UNK4, 4);
 		(void)au_rd(au, 0, AU_REG_UNK5, 4);
 	}