Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/audio audio(4): Make sure to return ENXIO if device ...



details:   https://anonhg.NetBSD.org/src/rev/a37f7f5ed09d
branches:  trunk
changeset: 1021495:a37f7f5ed09d
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Tue Jun 01 21:12:35 2021 +0000

description:
audio(4): Make sure to return ENXIO if device is being detached.

Don't return 0 indicating successful open of an unusable device!

diffstat:

 sys/dev/audio/audio.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 81abbfd7a5b9 -r a37f7f5ed09d sys/dev/audio/audio.c
--- a/sys/dev/audio/audio.c     Tue Jun 01 21:12:24 2021 +0000
+++ b/sys/dev/audio/audio.c     Tue Jun 01 21:12:35 2021 +0000
@@ -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 @@
        mutex_enter(sc->sc_lock);
        if (sc->sc_dying) {
                mutex_exit(sc->sc_lock);
+               error = ENXIO;
                goto bad;
        }
 



Home | Main Index | Thread Index | Old Index