diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -139,6 +139,7 @@ { struct snddev_info *d = device_get_softc(dev); struct pcm_channel *ch; + int err = 0; PCM_LOCK(d); PCM_WAIT(d); @@ -147,13 +148,12 @@ if (!ch) { device_printf(d->dev, "chn_init(%s, %d, %p) failed\n", cls->name, dir, devinfo); - PCM_UNLOCK(d); - return (ENODEV); + err = ENODEV; } PCM_RELEASE(d); PCM_UNLOCK(d); - return (0); + return (err); } static void