Source-Changes-HG archive

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

[src/nick-nhusb]: src/sys/dev/usb Another merge botch



details:   https://anonhg.NetBSD.org/src/rev/9423643e5c78
branches:  nick-nhusb
changeset: 334582:9423643e5c78
user:      skrll <skrll%NetBSD.org@localhost>
date:      Tue Dec 27 15:25:41 2016 +0000

description:
Another merge botch

diffstat:

 sys/dev/usb/ucom.c |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (42 lines):

diff -r 1a581d3232cc -r 9423643e5c78 sys/dev/usb/ucom.c
--- a/sys/dev/usb/ucom.c        Tue Dec 27 15:22:10 2016 +0000
+++ b/sys/dev/usb/ucom.c        Tue Dec 27 15:25:41 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ucom.c,v 1.108.2.35 2016/12/27 15:22:10 skrll Exp $    */
+/*     $NetBSD: ucom.c,v 1.108.2.36 2016/12/27 15:25:41 skrll Exp $    */
 
 /*
  * Copyright (c) 1998, 2000, 2016 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.108.2.35 2016/12/27 15:22:10 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.108.2.36 2016/12/27 15:25:41 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1639,6 +1639,7 @@
                return;
        }
 
+       mutex_exit(&sc->sc_lock);
        ub->ub_data = usbd_get_buffer(xfer);
        if (sc->sc_methods->ucom_read != NULL) {
                sc->sc_methods->ucom_read(sc->sc_parent, sc->sc_portno,
@@ -1649,6 +1650,15 @@
 
        ub->ub_len = cc;
 
+       mutex_enter(&sc->sc_lock);
+       if (sc->sc_dying) {
+               if (--sc->sc_refcnt < 0)
+                       cv_broadcast(&sc->sc_detachcv);
+               mutex_exit(&sc->sc_lock);
+               DPRINTF("... dying", 0, 0, 0, 0);
+               return;
+       }
+
        SIMPLEQ_INSERT_TAIL(&sc->sc_ibuff_full, ub, ub_link);
 
        ucom_read_complete(sc);



Home | Main Index | Thread Index | Old Index