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
This commit is contained in:
cognet 2003-01-14 17:13:52 +00:00
parent 606954dc42
commit 84edc3c4f0

View File

@ -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));