From e550089d43cd2d6f1047199268ec8a5074ddc65e Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Tue, 14 Jan 2003 17:13:52 +0000 Subject: [PATCH] Don't call destroy_dev it a channel has children. vchan creation doesn't lead to /dev entry creation if the new vchan is the first child of a channel, This fix a panic that happens when loading a sound driver module, creating vchans and unloading the driver. Approved by: cg MFC after: 3 days --- sys/dev/sound/pcm/sound.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 2b77684a96c..c184a69e13e 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -536,7 +536,7 @@ pcm_killchan(device_t dev) snd_mtxunlock(d->lock); ch = sce->channel; - error = pcm_chn_remove(d, sce->channel, 1); + error = pcm_chn_remove(d, sce->channel, SLIST_EMPTY(&ch->children)); if (error) return (error); return (pcm_chn_destroy(ch));