diff --git a/sys/dev/audio/audio.c b/sys/dev/audio/audio.c index 7aa1a2015bab..04c8b5999977 100644 --- a/sys/dev/audio/audio.c +++ b/sys/dev/audio/audio.c @@ -1366,10 +1366,12 @@ audiodetach(device_t self, int flags) */ maj = cdevsw_lookup_major(&audio_cdevsw); mn = device_unit(self); - vdevgone(maj, mn|SOUND_DEVICE, mn|SOUND_DEVICE, VCHR); - vdevgone(maj, mn|AUDIO_DEVICE, mn|AUDIO_DEVICE, VCHR); - vdevgone(maj, mn|AUDIOCTL_DEVICE, mn|AUDIOCTL_DEVICE, VCHR); - vdevgone(maj, mn|MIXER_DEVICE, mn|MIXER_DEVICE, VCHR); + if (mn <= 0xf) { + vdevgone(maj, mn|SOUND_DEVICE, mn|SOUND_DEVICE, VCHR); + vdevgone(maj, mn|AUDIO_DEVICE, mn|AUDIO_DEVICE, VCHR); + vdevgone(maj, mn|AUDIOCTL_DEVICE, mn|AUDIOCTL_DEVICE, VCHR); + vdevgone(maj, mn|MIXER_DEVICE, mn|MIXER_DEVICE, VCHR); + } /* * This waits currently running sysctls to finish if exists.