Module Name: src
Committed By: riastradh
Date: Tue Jun 1 21:12:36 UTC 2021
Modified Files:
src/sys/dev/audio: audio.c
Log Message:
audio(4): Make sure to return ENXIO if device is being detached.
Don't return 0 indicating successful open of an unusable device!
To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/sys/dev/audio/audio.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/audio/audio.c
diff -u src/sys/dev/audio/audio.c:1.96 src/sys/dev/audio/audio.c:1.97
--- src/sys/dev/audio/audio.c:1.96 Tue Jun 1 21:12:24 2021
+++ src/sys/dev/audio/audio.c Tue Jun 1 21:12:35 2021
@@ -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
mutex_enter(sc->sc_lock);
if (sc->sc_dying) {
mutex_exit(sc->sc_lock);
+ error = ENXIO;
goto bad;
}