Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb properly wait for refcounts to drain.



details:   https://anonhg.NetBSD.org/src/rev/d955c25f2c94
branches:  trunk
changeset: 956326:d955c25f2c94
user:      mrg <mrg%NetBSD.org@localhost>
date:      Mon Oct 26 12:24:10 2020 +0000

description:
properly wait for refcounts to drain.
fixes panic at detach that jmnceill saw.

XXX: pullup-[89].

diffstat:

 sys/dev/usb/ucom.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 2dee3f2effb8 -r d955c25f2c94 sys/dev/usb/ucom.c
--- a/sys/dev/usb/ucom.c        Mon Oct 26 11:49:45 2020 +0000
+++ b/sys/dev/usb/ucom.c        Mon Oct 26 12:24:10 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ucom.c,v 1.127 2020/03/14 02:35:33 christos Exp $      */
+/*     $NetBSD: ucom.c,v 1.128 2020/10/26 12:24:10 mrg Exp $   */
 
 /*
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.127 2020/03/14 02:35:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.128 2020/10/26 12:24:10 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -434,7 +434,7 @@
        }
 
        sc->sc_refcnt--;
-       while (sc->sc_refcnt > 0) {
+       while (sc->sc_refcnt >= 0) {
                /* Wake up anyone waiting */
                if (tp != NULL) {
                        mutex_spin_enter(&tty_lock);



Home | Main Index | Thread Index | Old Index