From 6dfcf035bdec6374f8feab5e171d1a4383687ff2 Mon Sep 17 00:00:00 2001 From: riastradh Date: Tue, 3 Dec 2019 05:01:58 +0000 Subject: Fix inequality for refcnt drain: -1 here means all refs gone. --- sys/dev/usb/usbnet.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/usb/usbnet.c b/sys/dev/usb/usbnet.c index 40cbbab8398..6645bd12762 100644 --- a/sys/dev/usb/usbnet.c +++ b/sys/dev/usb/usbnet.c @@ -1,4 +1,4 @@ -/* $NetBSD: usbnet.c,v 1.31 2019/12/03 05:01:45 riastradh Exp $ */ +/* $NetBSD: usbnet.c,v 1.32 2019/12/03 05:01:58 riastradh Exp $ */ /* * Copyright (c) 2019 Matthew R. Green @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.31 2019/12/03 05:01:45 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.32 2019/12/03 05:01:58 riastradh Exp $"); #include #include @@ -1519,7 +1519,7 @@ usbnet_detach(device_t self, int flags) mutex_enter(&unp->unp_lock); unp->unp_refcnt--; - while (unp->unp_refcnt > 0) { + while (unp->unp_refcnt >= 0) { /* Wait for processes to go away */ cv_wait(&unp->unp_detachcv, &unp->unp_lock); } -- cgit