Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb don't forget to destroy the new sc_media_mtx mutex.



details:   https://anonhg.NetBSD.org/src/rev/916b3cb8004f
branches:  trunk
changeset: 971711:916b3cb8004f
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sat May 02 00:50:07 2020 +0000

description:
don't forget to destroy the new sc_media_mtx mutex.

now re-plugging and re-using the same softc doesn't give mutex
already initialised error.

diffstat:

 sys/dev/usb/if_urtwn.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r cd10b4de211c -r 916b3cb8004f sys/dev/usb/if_urtwn.c
--- a/sys/dev/usb/if_urtwn.c    Fri May 01 22:27:42 2020 +0000
+++ b/sys/dev/usb/if_urtwn.c    Sat May 02 00:50:07 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_urtwn.c,v 1.86 2020/04/16 17:18:27 nat Exp $        */
+/*     $NetBSD: if_urtwn.c,v 1.87 2020/05/02 00:50:07 mrg Exp $        */
 /*     $OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $       */
 
 /*-
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.86 2020/04/16 17:18:27 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.87 2020/05/02 00:50:07 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -584,6 +584,8 @@
                ieee80211_ifdetach(&sc->sc_ic);
                if_detach(ifp);
 
+               mutex_destroy(&sc->sc_media_mtx);
+
                /* Close Tx/Rx pipes.  Abort done by urtwn_stop. */
                urtwn_close_pipes(sc);
        }



Home | Main Index | Thread Index | Old Index