summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2021-06-01 21:12:35 +0000
committerriastradh <riastradh@NetBSD.org>2021-06-01 21:12:35 +0000
commit1fc4faa2a55f31315075e9a945e8db48783c6a0b (patch)
tree3957b18e5ca697f50a7fe17474fefdb5f9b2bf8b /sys/dev
parent547dea287f98a1437aecea9b2e258322c99d90a1 (diff)
audio(4): Make sure to return ENXIO if device is being detached.
Don't return 0 indicating successful open of an unusable device!
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/audio/audio.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/audio/audio.c b/sys/dev/audio/audio.c
index 1a5138bcba8..bf3e5580435 100644
--- a/sys/dev/audio/audio.c
+++ b/sys/dev/audio/audio.c
@@ -1,4 +1,4 @@
-/* $NetBSD: audio.c,v 1.96 2021/06/01 21:12:24 riastradh Exp $ */
+/* $NetBSD: audio.c,v 1.97 2021/06/01 21:12:35 riastradh Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -138,7 +138,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.96 2021/06/01 21:12:24 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.97 2021/06/01 21:12:35 riastradh Exp $");
#ifdef _KERNEL_OPT
#include "audio.h"
@@ -2458,6 +2458,7 @@ audio_open(dev_t dev, struct audio_softc *sc, int flags, int ifmt,
mutex_enter(sc->sc_lock);
if (sc->sc_dying) {
mutex_exit(sc->sc_lock);
+ error = ENXIO;
goto bad;
}