⬢ DragonFlyBSD Kernel Audit
DF-4192 / fix.diff
← back to finding ↓ download raw
diff --git a/a/sys/dev/sound/pcm/channel.c b/b/sys/dev/sound/pcm/channel.c
index eef78e7..a25d53b 100644
--- a/a/sys/dev/sound/pcm/channel.c
+++ b/b/sys/dev/sound/pcm/channel.c
@@ -2198,7 +2198,7 @@ chn_trigger(struct pcm_channel *c, int go)
 			c->trigger = go;
 			CHN_UNLOCK(c);
 			PCM_LOCK(d);
-			CHN_INSERT_HEAD(d, c, channels.pcm.busy);
+			CHN_INSERT_HEAD_SAFE(d, c, channels.pcm.busy);
 			PCM_UNLOCK(d);
 			CHN_LOCK(c);
 			chn_syncstate(c);
@@ -2215,7 +2215,7 @@ chn_trigger(struct pcm_channel *c, int go)
 			c->trigger = go;
 			CHN_UNLOCK(c);
 			PCM_LOCK(d);
-			CHN_REMOVE(d, c, channels.pcm.busy);
+			CHN_REMOVE_SAFE(d, c, channels.pcm.busy);
 			PCM_UNLOCK(d);
 			CHN_LOCK(c);
 		}