Module Name: src Committed By: mlelstv Date: Thu May 2 09:19:28 UTC 2019
Modified Files: src/sys/dev: audio.c Log Message: take interrupt lock when closing backend. To generate a diff of this commit: cvs rdiff -u -r1.459 -r1.460 src/sys/dev/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.c diff -u src/sys/dev/audio.c:1.459 src/sys/dev/audio.c:1.460 --- src/sys/dev/audio.c:1.459 Wed Feb 27 02:27:38 2019 +++ src/sys/dev/audio.c Thu May 2 09:19:28 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: audio.c,v 1.459 2019/02/27 02:27:38 mrg Exp $ */ +/* $NetBSD: audio.c,v 1.460 2019/05/02 09:19:28 mlelstv Exp $ */ /*- * Copyright (c) 2016 Nathanial Sloss <nathanialsl...@yahoo.com.au> @@ -148,7 +148,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.459 2019/02/27 02:27:38 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.460 2019/05/02 09:19:28 mlelstv Exp $"); #ifdef _KERNEL_OPT #include "audio.h" @@ -2366,8 +2366,11 @@ audio_open(dev_t dev, struct audio_softc bad: audio_destroy_pfilters(vc); audio_destroy_rfilters(vc); - if (hw->close != NULL && sc->sc_opens == 0 && sc->sc_recopens == 0) + if (hw->close != NULL && sc->sc_opens == 0 && sc->sc_recopens == 0) { + mutex_enter(sc->sc_intr_lock); hw->close(sc->hw_hdl); + mutex_exit(sc->sc_intr_lock); + } mutex_exit(sc->sc_lock); if (sc->sc_usemixer) { audio_free_ring(sc, &vc->sc_mpr);